{"ScriptPreparationCode":"function getRandomInt(max) {\r\n return Math.floor(Math.random() * Math.floor(max));\r\n}\r\n\r\nvar testArr = [];\r\nfor (var i = 0; i \u003C 100000; i\u002B\u002B) {\r\n testArr.push(String(getRandomInt(1000)));\r\n}","TestCases":[{"Name":"Array Unique","Code":"const { resultArray } = testArr.reduce((result, item) =\u003E {\r\n \r\n if(!result.resultMap[item]){\r\n result.resultMap[item] = true;\r\n result.resultArray.push(item)\r\n }\r\n return result;\r\n}, {resultArray: [], resultMap: {}});\r\n\r\nreturn resultArray;","IsDeferred":false},{"Name":"For Loop","Code":"const resultArray = [];\r\nconst resultMap = {};\r\n\r\nfor(let item of testArr) {\r\n if(!resultMap[item]){ \r\n resultMap[item] = true;\r\n resultArray.push(item)\r\n }\r\n}\r\n\r\nreturn resultArray;","IsDeferred":false},{"Name":"Array from Set","Code":"[...new Set(testArr)]","IsDeferred":false},{"Name":"Lodash Uniq","Code":"_.uniq(testArr)","IsDeferred":false}]}