{"ScriptPreparationCode":"var myArr = Array.from({\r\n length: 16000\r\n}, () =\u003E ({ value: Math.floor(Math.random() * 1000) }));\r\n\r\nvar myCopy = null;","TestCases":[{"Name":"Lodash uniqBy","Code":"myCopy = _.uniqBy(myArr, \u0027value\u0027).map(({ value }) =\u003E value);","IsDeferred":false},{"Name":"new Set() Destructuring","Code":"myCopy = [...new Set(myArr.map(({ value }) =\u003E value))]","IsDeferred":false},{"Name":"uniq for loop","Code":"var seen = {};\r\nvar out = [];\r\nconst len = myArr.length;\r\nvar j = 0;\r\nfor (var i = 0; i \u003C len; i \u002B= 1) {\r\n\tvar item = myArr[i].value;\r\n if (seen[item] !== 1) {\r\n \tseen[item] = 1;\r\n out[j\u002B\u002B] = item;\r\n }\r\n}\r\nmyCopy = out;","IsDeferred":false},{"Name":"uniq by forEach","Code":"var result = [];\r\nmyArr.forEach((item) =\u003E {\r\n\tif (result.indexOf(item.value) \u003C 0) {\r\n \tresult.push(item.value);\r\n }\r\n});\r\nmyCopy = result;","IsDeferred":false},{"Name":"uniq by filter","Code":"var mapMyArr = myArr.map(({ value }) =\u003E value);\r\nmyCopy = mapMyArr.filter((value, index, array) =\u003E array.indexOf(value) === index);","IsDeferred":false}]}