{"ScriptPreparationCode":"var users = [\r\n { \u0027name\u0027: \u0027barney\u0027, \u0027age\u0027: 36 },\r\n { \u0027name\u0027: \u0027pebbles\u0027, \u0027age\u0027: 5 }\r\n];\r\n\r\nvar newUsers = [\r\n { \u0027name\u0027: \u0027fred\u0027, \u0027age\u0027: 40 },\r\n { \u0027name\u0027: \u0027barney\u0027, \u0027age\u0027: 36 },\r\n { \u0027name\u0027: \u0027pebbles\u0027, \u0027age\u0027: 2 }\r\n];\r\n\r\nfor(let i = 0; i \u003C 2000; i\u002B\u002B) {\r\n var newUser = { \u0027name\u0027: \u0027user_\u0027 \u002B i, \u0027age\u0027: Math.floor(Math.random() * i) };\r\n newUsers.push(newUser);\r\n}\r\n\r\nfunction uniques(arr) { \r\n const trackingSet = new Set();\r\n return arr.map(function (obj) { \r\n if(!trackingSet.has(obj.name)) {\r\n trackingSet.add(obj.name)\r\n return obj;\r\n } \r\n });\r\n}","TestCases":[{"Name":"uniqWith","Code":"const unionUsers1 = _.uniqWith(newUsers.concat(users), _.isEqual);","IsDeferred":false},{"Name":"uniqBy","Code":"const unionUsers2 = _.uniqBy(newUsers.concat(users), \u0027name\u0027);","IsDeferred":false},{"Name":"ES6 Set","Code":"const unionUsers3 = uniques(newUsers.concat(users));","IsDeferred":false}]}