{"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}","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}]}