{"ScriptPreparationCode":"function spliceFlatten(arr) {\r\n for (var i = 0; i \u003C arr.length; \u002B\u002Bi) {\r\n if (Array.isArray(arr[i])) {\r\n // need to add i and 1 as arguments to the real splice command,\r\n // plus all the values of arr[i]\r\n arr[i].splice(0, 0, i, 1);\r\n Array.prototype.splice.apply(arr, arr[i]);\r\n \r\n // Check for more inner arrays at beginning of this array\r\n --i;\r\n }\r\n }\r\n \r\n return arr;\r\n }\r\n\r\nfunction copySpliceFlatten(arr) {\r\n arr = arr.slice(0);\r\n for (var i = 0; i \u003C arr.length; \u002B\u002Bi) {\r\n if (Array.isArray(arr[i])) {\r\n arr[i] = arr[i].slice(0);\r\n // need to add i and 1 as arguments to the real splice command,\r\n // plus all the values of arr[i]\r\n arr[i].splice(0, 0, i, 1);\r\n Array.prototype.splice.apply(arr, arr[i]);\r\n \r\n // Check for more inner arrays at beginning of this array\r\n --i;\r\n }\r\n }\r\n \r\n return arr;\r\n }\r\n\r\nvar a = [1, [2, 3],\r\n [\r\n [\r\n [\r\n [4]\r\n ]\r\n ], 5\r\n ]\r\n ];\r\n var b = [1, 2];\r\n var c = [1, [\r\n [\r\n [\r\n [\r\n [\r\n [2]\r\n ]\r\n ]\r\n ]\r\n ]\r\n ]];\r\n var d = [\r\n [\u0022$6\u0022],\r\n [\u0022$12\u0022],\r\n [\u0022$25\u0022],\r\n [\u0022$25\u0022],\r\n [\u0022$18\u0022],\r\n [\u0022$22\u0022],\r\n [\u0022$10\u0022],\r\n [\u0022$0\u0022],\r\n [\u0022$15\u0022],\r\n [\u0022$3\u0022],\r\n [\u0022$75\u0022],\r\n [\u0022$5\u0022],\r\n [\u0022$100\u0022],\r\n [\u0022$7\u0022],\r\n [\u0022$3\u0022],\r\n [\u0022$75\u0022],\r\n [\u0022$5\u0022]\r\n ];","TestCases":[{"Name":"spliceFlatten","Code":"spliceFlatten(a);\r\nspliceFlatten(b);\r\nspliceFlatten(c);\r\nspliceFlatten(d);","IsDeferred":false},{"Name":"copySpliceFlatten","Code":"copySpliceFlatten(a);\r\ncopySpliceFlatten(b);\r\ncopySpliceFlatten(c);\r\ncopySpliceFlatten(d);","IsDeferred":false}]}