{"ScriptPreparationCode":"var array = Array.from({length: 40}, () =\u003E Math.floor(Math.random() * 140));","TestCases":[{"Name":"Set spread","Code":"const f = [... new Set(array)]","IsDeferred":false},{"Name":"Array from set","Code":"const s = new Set(array)\r\nconst l = Array.from(s)","IsDeferred":false},{"Name":"Filter","Code":"const b = array.filter((i,index) =\u003E array.indexOf(i)=== index)","IsDeferred":false},{"Name":"Basic forEach","Code":"const set = {}\r\n\r\narray.forEach(val =\u003E set.hasOwnProperty(val) ? set[val] = true : \u0027\u0027)\r\nconst b = Object.keys(set)","IsDeferred":false},{"Name":"for loop","Code":"const set = {}\r\n\r\nfor(var i = 0, l = array.length; i \u003C l; i\u002B\u002B){\r\n if(!set.hasOwnProperty(array[i])) set[array[i]] = true\r\n}\r\nconst b = Object.keys(set)","IsDeferred":false},{"Name":"filterWithSet","Code":"const set = {}\r\nconst b = array.filter((val) =\u003E {\r\n if(!set.hasOwnProperty(val)) { \r\n set[val] = true\r\n return true\r\n }\r\n return false\r\n})","IsDeferred":false}]}