{"ScriptPreparationCode":"var myArr = Array.from({\r\n length: 1_000_000\r\n}, () =\u003E ({ id: Math.floor(Math.random() * 1000) }));\r\n\r\nvar myArr2 = Array.from({\r\n length: 1_000_000\r\n}, () =\u003E ({ id: Math.floor(Math.random() * 1000) }));\r\n\r\n\r\nvar myCopy = null;","TestCases":[{"Name":"uniqBy","Code":"myCopy = _.uniqBy([...myArr, ...myArr2], \u0027id\u0027);","IsDeferred":false},{"Name":"Set with filter","Code":"myCopy = (() =\u003E {\r\n const existingIds = new Set(myArr.map((machine) =\u003E machine.id));\r\n const newMachines = myArr2.filter((machine) =\u003E !existingIds.has(machine.id));\r\n\r\n return update(myArr, {\r\n $push: newMachines,\r\n });\r\n})();","IsDeferred":false}]}