{"ScriptPreparationCode":"var arr = [];\r\nvar object = { \r\n\ttype: \u0027aaa\u0027,\r\n subtype: \u0027bbb\u0027,\r\n card_last4:\u0027bbb\u0027,\r\n card_type:\u0027bbb\u0027,\r\n card_exp_month:\u0027bbb\u0027,\r\n card_exp_year:\u0027bbb\u0027,\r\n card_country:\u0027bbb\u0027,\r\n foo: \u0027bar\u0027\r\n};\r\nfor (var i = 0; i \u003C= 10; i\u002B\u002B) { arr.push(object); }","TestCases":[{"Name":"Lodash pick","Code":"arr.map(function (element) {\r\n\treturn _.pick(\r\n \telement,\r\n \t\u0027type\u0027,\r\n \u0027subtype\u0027,\r\n \u0027card_last4\u0027,\r\n \u0027card_type\u0027,\r\n \u0027card_exp_month\u0027,\r\n \u0027card_exp_year\u0027,\r\n \u0027card_country\u0027,\r\n \u0027something\u0027\r\n );\r\n});","IsDeferred":false},{"Name":"Native pick","Code":"function pick(object, keys) {\r\n return keys.reduce((obj, key) =\u003E {\r\n if (object \u0026\u0026 object.hasOwnProperty(key)) {\r\n obj[key] = object[key];\r\n }\r\n return obj;\r\n }, {});\r\n}\r\n\r\narr.map(function (element) {\r\n return pick(\r\n element,\r\n [\u0027type\u0027,\r\n \u0027subtype\u0027,\r\n \u0027card_last4\u0027,\r\n \u0027card_type\u0027,\r\n \u0027card_exp_month\u0027,\r\n \u0027card_exp_year\u0027,\r\n \u0027card_country\u0027,\r\n \u0027something\u0027]\r\n );\r\n});","IsDeferred":false}]}