{"ScriptPreparationCode":"var arr = [1,2,3,4,5,6,7,8,9];","TestCases":[{"Name":"splice 1","Code":"function arrayMove(arr, fromIndex, toIndex) {\r\n const length = arr.length;\r\n const copiedArr = [...arr];\r\n \r\n if (fromIndex !== toIndex \u0026\u0026 length \u003E fromIndex \u0026\u0026 length \u003E toIndex) {\r\n copiedArr.splice(toIndex, 0, copiedArr.splice(fromIndex, 1)[0]);\r\n }\r\n \r\n return copiedArr;\r\n}\r\n\r\narrayMove(arr, 0, 3)","IsDeferred":false},{"Name":"splice 2","Code":"function arrayMove(arr, fromIndex, toIndex) {\r\n const length = arr.length;\r\n let element = arr[fromIndex];\r\n \r\n if (fromIndex !== toIndex \u0026\u0026 length \u003E fromIndex \u0026\u0026 length \u003E toIndex) {\r\n arr.splice(fromIndex, 1);\r\n arr.splice(toIndex \u002B 1, 0, element);\r\n }\r\n \r\n}\r\n\r\narrayMove(arr, 0, 3)","IsDeferred":false}]}