{"ScriptPreparationCode":"var array = [];\r\nfor (let i = 0; i \u003C 100000; i\u002B\u002B) {array.push(~~(Math.random() * 2000))}","TestCases":[{"Name":"Spread","Code":"return [...new Set(array)]","IsDeferred":false},{"Name":"use lodash","Code":"return _.uniq(array);","IsDeferred":false},{"Name":"Array.from","Code":"return Array.from( new Set(array) );","IsDeferred":false},{"Name":"For","Code":"const visited = {};\r\nconst uniques = [];\r\nconst initial = array;\r\nfor(let i=0;i\u003Cinitial.lenght;i\u002B\u002B){\r\n if(!visited[initial[i]]) {\r\n visited[initial[i]] = true;\r\n uniques.push(initial[i]);\r\n }\r\n}\r\nreturn uniques","IsDeferred":false},{"Name":"For memory optimized","Code":"const visited = {};\r\nconst uniques = [];\r\nconst initial = array;\r\nfor(let i=0;i\u003Cinitial.lenght;i\u002B\u002B){\r\n if(!(initial[i] in visited)) {\r\n visited[initial[i]] = undefined;\r\n uniques.push(initial[i]);\r\n }\r\n}\r\nreturn uniques","IsDeferred":false}]}