{"ScriptPreparationCode":"function dec2hex (dec) {\r\n return dec \u003C 10\r\n ? \u00270\u0027 \u002B String(dec)\r\n : dec.toString(16)\r\n}\r\n\r\nfunction generateId (len) {\r\n var arr = new Uint8Array((len || 40) / 2)\r\n window.crypto.getRandomValues(arr)\r\n return Array.from(arr, dec2hex).join(\u0027\u0027)\r\n}\r\n\r\nvar a = []\r\nvar b = []\r\nfor( let i = 0; i \u003C 1000; i\u002B\u002B)\r\n{\r\n a[i] = generateId(16)\r\n b[i] = generateId(16)\r\n}","TestCases":[{"Name":"current xor implementation","Code":"const res = _.xor(a,b)","IsDeferred":false},{"Name":"alternative with Sets","Code":"function xor(arr1, arr2) {\r\n const set1 = new Set(arr1);\r\n const set2 = new Set(arr2);\r\n const unique1 = arr1.filter((value) =\u003E !set2.has(value));\r\n const unique2 = arr2.filter((value) =\u003E !set1.has(value));\r\n return Array.from(new Set(unique1.concat(unique2)));\r\n}\r\n\r\nconst res = xor(a,b)","IsDeferred":false}]}