{"ScriptPreparationCode":"function pick1(obj, keys) {\r\n\r\n var res = {};\r\n if (typeof keys === \u0027string\u0027) {\r\n if (keys in obj) {\r\n res[keys] = obj[keys];\r\n }\r\n return res;\r\n }\r\n\r\n var len = keys.length;\r\n var idx = -1;\r\n\r\n while (\u002B\u002Bidx \u003C len) {\r\n var key = keys[idx];\r\n if (key in obj) {\r\n res[key] = obj[key];\r\n }\r\n }\r\n return res;\r\n};\r\n\r\nvar pick2 = new Function(\u0027el\u0027, \u0027if (!el) return {}; const res = {}; \u0027 \u002B \r\n \u0027if (\u0022a\u0022 in el) res.a = el.a;\u0027 \u002B \r\n \u0027if (\u0022d\u0022 in el) res.d = el.d;\u0027 \u002B \r\n \u0027if (\u0022i\u0022 in el) res.i = el.i;\u0027 \u002B \r\n \u0027 return res;\u0027)\r\n\r\n\r\nfunction pick3(obj, keys) {\r\n const hasOwn = Object.prototype.hasOwnProperty;\r\n var res = {};\r\n if (typeof keys === \u0027string\u0027) {\r\n if (hasOwn.call(obj, keys)) {\r\n res[keys] = obj[keys];\r\n }\r\n return res;\r\n }\r\n\r\n var len = keys.length;\r\n var idx = -1;\r\n\r\n while (\u002B\u002Bidx \u003C len) {\r\n var key = keys[idx];\r\n if (hasOwn.call(obj, key)) {\r\n res[key] = obj[key];\r\n }\r\n }\r\n return res;\r\n};\r\n\r\nvar pick4 = new Function(\u0027el\u0027, \u0027if (!el) return {}; const hasOwn = Object.prototype.hasOwnProperty; const res = {}; \u0027 \u002B \r\n \u0027if (hasOwn.call(el, \u0022a\u0022)) res.a = el.a;\u0027 \u002B \r\n \u0027if (hasOwn.call(el, \u0022d\u0022)) res.d = el.d;\u0027 \u002B \r\n \u0027if (hasOwn.call(el, \u0022i\u0022)) res.i = el.i;\u0027 \u002B \r\n \u0027 return res;\u0027)\r\n\r\nfunction getRandomInt(min, max) {\r\n min = Math.ceil(min);\r\n max = Math.floor(max);\r\n return Math.floor(Math.random() * (max - min) \u002B min); //The maximum is exclusive and the minimum is inclusive\r\n}\r\n\r\n\r\nvar data = [];\r\n\r\nfor (let i = 0; i \u003C 10000; i\u002B\u002B) {\r\n const obj = {};\r\n\tconst propsCount = getRandomInt(0, 10);\r\n \r\n \tfor (let j = 0; j \u003C propsCount; j\u002B\u002B) {\r\n\t\t\r\n\t \tconst propCode = getRandomInt(97, 122);\r\n \r\n \t\tobj[String.fromCharCode(propCode)] = propCode;\r\n\t}\r\n \r\n data.push(obj);\r\n}","TestCases":[{"Name":"Lodash","Code":"data.map((obj) =\u003E _.pick(obj, [\u0027a\u0027,\u0027d\u0027,\u0027i\u0027]))","IsDeferred":false},{"Name":"native pick","Code":"data.map((obj) =\u003E pick1(obj, [\u0027a\u0027,\u0027d\u0027,\u0027i\u0027]))","IsDeferred":false},{"Name":"compiled function","Code":"data.map((obj) =\u003E pick2(obj, [\u0027a\u0027,\u0027d\u0027,\u0027i\u0027]))","IsDeferred":false},{"Name":"native pick (own)","Code":"data.map((obj) =\u003E pick3(obj, [\u0027a\u0027,\u0027d\u0027,\u0027i\u0027]))","IsDeferred":false},{"Name":"compiled (own)","Code":"data.map((obj) =\u003E pick4(obj, [\u0027a\u0027,\u0027d\u0027,\u0027i\u0027]))","IsDeferred":false}]}