{"ScriptPreparationCode":"var array1 = [];\r\nfor (let i = 0; i \u003C 100000; i\u002B\u002B) {\r\n array1.push(Math.floor((Math.random() * 10) \u002B 1));\r\n}\r\nvar array2 = [];\r\nfor (let i = 0; i \u003C 100000; i\u002B\u002B) {\r\n array2.push(Math.floor((Math.random() * 10) \u002B 1));\r\n}","TestCases":[{"Name":"Set \u002B spread","Code":"const uniqueValues = (arr1, arr2) =\u003E {\r\n const values = new Set(arr1)\r\n for(const value of arr2) {\r\n values.add(value)\r\n }\r\n return [...values]\r\n}\r\nuniqueValues(array1, array2)","IsDeferred":false},{"Name":"Set \u002B Array.from","Code":"const uniqueValues = (arr1, arr2) =\u003E {\r\n const values = new Set(arr1)\r\n for(const value of arr2) {\r\n values.add(value)\r\n }\r\n return Array.from(values)\r\n}\r\nuniqueValues(array1, array2)","IsDeferred":false},{"Name":"Concat \u002B spread","Code":"const uniqueValues = (arr1, arr2) =\u003E {\r\n return [...new Set(arr1.concat(arr2))]\r\n for(const value of arr2) {\r\n values.add(value)\r\n }\r\n return [...values]\r\n}\r\nuniqueValues(array1, array2)","IsDeferred":false},{"Name":"lastIndexOf","Code":"const uniqueValues = (arr1, arr2) =\u003E {\r\n const array = arr1.concat(arr2)\r\n return array.filter((item, index) =\u003E array.lastIndexOf(item) != index);\r\n}\r\nuniqueValues(array1, array2)","IsDeferred":false}]}