{"ScriptPreparationCode":"function tempSwap(array) {\r\n const length = array.length;\r\n const swap1 = Math.floor(Math.random() * length);\r\n const swap2 = Math.floor(Math.random() * length);\r\n const temp = array[swap1];\r\n\r\n array[swap1] = array[swap2];\r\n array[swap2] = array[temp];\r\n}\r\n\r\nfunction destructuringSwap(array) {\r\n const length = array.length;\r\n const swap1 = Math.floor(Math.random() * length);\r\n const swap2 = Math.floor(Math.random() * length);\r\n\r\n return [\r\n array[swap1],\r\n array[swap2]\r\n ] = [\r\n array[swap2],\r\n array[swap1]\r\n ];\r\n}\r\n\r\nfunction xorSwap(array) {\r\nconst length = array.length;\r\n const swap1 = Math.floor(Math.random() * length);\r\n const swap2 = Math.floor(Math.random() * length);\r\n array[swap1] ^= array[swap2];\r\n array[swap2] ^= array[swap1];\r\n array[swap1] ^= array[swap2];\r\n}","TestCases":[{"Name":"Length 10 temp swap","Code":"tempSwap(new Array(10));","IsDeferred":false},{"Name":"Length 10 destructuring swap","Code":"destructuringSwap(new Array(10));","IsDeferred":false},{"Name":"Length 100 temp swap","Code":"tempSwap(new Array(100));","IsDeferred":false},{"Name":"Length 100 destructuring swap","Code":"destructuringSwap(new Array(100));","IsDeferred":false},{"Name":"Length 1000 temp swap","Code":"tempSwap(new Array(1000));","IsDeferred":false},{"Name":"Length 1000 destructuring swap","Code":"destructuringSwap(new Array(1000));","IsDeferred":false},{"Name":"Length 10 xor swap","Code":"xorSwap(new Array(10));","IsDeferred":false},{"Name":"Length 100 xor swap","Code":"xorSwap(new Array(100));","IsDeferred":false},{"Name":"Length 1000 xor swap","Code":"xorSwap(new Array(1000));","IsDeferred":false}]}