{"ScriptPreparationCode":"function randomString() {\r\n var length = Math.ceil(Math.random() * 100);\r\n var possible = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\u0027;\r\n\r\n var text = \u0027\u0027;\r\n for (var i=0; i \u003C length; i\u002B\u002B) {\r\n text \u002B= possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n \r\n return text; \r\n}\r\n\r\nfunction createObject() {\r\n return {\r\n num1: Math.random(),\r\n num2: Math.random(),\r\n num3: Math.random(Math.random()),\r\n str1: randomString(),\r\n str2: randomString(),\r\n str3: randomString(),\r\n bool1: true,\r\n bool2: false,\r\n obj1: {\r\n prop1: randomString(),\r\n prop2: Math.random(),\r\n prop3: true,\r\n },\r\n obj2: {\r\n prop1: randomString(),\r\n prop2: Math.random(),\r\n prop3: false,\r\n },\r\n arr1: [1,2,3,4,5,6,7,8,9,0],\r\n arr2: [\r\n randomString(),\r\n randomString(),\r\n randomString(),\r\n randomString(),\r\n randomString(),\r\n randomString(),\r\n randomString(),\r\n ],\r\n }\r\n}\r\n\r\ncollection = Array(1000).fill(0).map(createObject);\r\n","TestCases":[{"Name":"underscorePick1","Code":" const mapped = collection.map((data) =\u003E ({\r\n ..._(data).pick(\u0027num3\u0027, \u0027str1\u0027, \u0027str2\u0027, \u0027bool2\u0027, \u0027arr1\u0027, \u0027obj1\u0027),\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));\r\n","IsDeferred":false},{"Name":"underscorePick2","Code":"const mapped = collection.map((data) =\u003E ({\r\n ..._.pick(data, \u0027num3\u0027, \u0027str1\u0027, \u0027str2\u0027, \u0027bool2\u0027, \u0027arr1\u0027, \u0027obj1\u0027),\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));","IsDeferred":false},{"Name":"underscoreOmit1","Code":"const mapped = collection.map((data) =\u003E ({\r\n ..._(data).omit(\u0027num1\u0027, \u0027num2\u0027, \u0027str3\u0027, \u0027bool1\u0027, \u0027obj2\u0027, \u0027arr2\u0027),\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));","IsDeferred":false},{"Name":"underscoreOmit2","Code":"const mapped = collection.map((data) =\u003E ({\r\n ..._.omit(data, \u0027num1\u0027, \u0027num2\u0027, \u0027str3\u0027, \u0027bool1\u0027, \u0027obj2\u0027, \u0027arr2\u0027),\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));","IsDeferred":false},{"Name":"objectUnion","Code":"const mapped = collection.map((data) =\u003E ({\r\n ...data,\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));","IsDeferred":false},{"Name":"objectCreate","Code":"const mapped = collection.map((data) =\u003E ({\r\n num1: data.num1 \u002B 10,\r\n num2: data.num2 \u002B 10,\r\n num3: data.num3,\r\n str1: data.str1,\r\n str2: data.str2,\r\n str3: data.str3 \u002B \u002712345\u0027,\r\n bool1: false,\r\n bool2: data.bool2,\r\n obj1: data.obj1,\r\n obj2: { ...data.obj2, prop1: \u00271212212\u0027},\r\n arr1: data.arr1,\r\n arr2: [data.arr2[0], data.arr2[1], data.arr2[2]]\r\n }));","IsDeferred":false},{"Name":"objectUpdate","Code":"const mapped = collection.map((data) =\u003E {\r\n data.num1 \u002B= 10;\r\n data.num2 \u002B= 10;\r\n data.str3 \u002B= \u002712345\u0027;\r\n data.bool1 = false;\r\n data.obj2.prop1 = \u00271212212\u0027;\r\n data.arr2.length = 3;\r\n\r\n return data;\r\n });","IsDeferred":false}]}