{"ScriptPreparationCode":null,"TestCases":[{"Name":"Destructuring","Code":"let myArray = [12, -2, 55, 68, 80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\r\n\r\nconst swapElementsDest = (array, index1, index2) =\u003E {\r\n [myArray[index1], myArray[index2]] = [myArray[index2], myArray[index1]];\r\n};\r\n\r\nfor(let i = 0; i \u003C myArray.length - 1; \u002B\u002Bi){\r\n\tswapElementsDest(myArray, i, i\u002B1)\r\n}","IsDeferred":false},{"Name":"Temporary Variable","Code":"let myArray = [12, -2, 55, 68, 80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\r\n\r\nconst swapElementsTemp = (array, index1, index2) =\u003E {\r\n let temp = array[index1];\r\n array[index1] = array[index2];\r\n array[index2] = temp;\r\n};\r\n\r\nfor(let i = 0; i \u003C myArray.length - 1; \u002B\u002Bi){\r\n\tswapElementsTemp(myArray, i, i\u002B1)\r\n}","IsDeferred":false}]}