{"ScriptPreparationCode":"var testArray = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZ\u0027.split(\u0027\u0027);\r\nvar delim = {\u0027a\u0027: 1};\r\n\r\nfunction spreadArrayComparisonAndConcat(array, delim) {\r\n return array.reduce(function (result, item, i) {\r\n return i === 0 ? result.concat(item) : result.concat(delim, item);\r\n }, []);\r\n}\r\n\r\nfunction spreadArrayConcat(array, delim) {\r\n return array.reduce(function (result, item, i) {\r\n return result.concat(delim, item);\r\n }, []).slice(0, -1);\r\n}\r\n\r\nfunction spreadArrayComparison(array, delim) {\r\n return array.reduce(function (result, item, i) {\r\n if (i === 0) {\r\n result.push(item);\r\n } else {\r\n result.push(delim, item);\r\n }\r\n \r\n return result;\r\n }, []);\r\n}\r\n\r\nfunction spreadArrayComparisonArrow(array, delim) {\r\n return array.reduce((result, item, i) =\u003E {\r\n if (i === 0) {\r\n result.push(item);\r\n } else {\r\n result.push(delim, item);\r\n }\r\n \r\n return result;\r\n }, []);\r\n}\r\n\r\nfunction spreadArrayPop(array, delim) {\r\n var r = array.reduce(function (result, item) {\r\n result.push(item, delim); \r\n return result;\r\n }, []);\r\n r.pop();\r\n return r;\r\n}\r\n\r\nfunction spreadArrayShift(array, delim) {\r\n var r = array.reduce(function (result, item) {\r\n result.push(delim, item); \r\n return result;\r\n }, []);\r\n r.shift();\r\n return r;\r\n}\r\n\r\nfunction spreadArraySlice(array, delim) {\r\n return array.reduce(function (result, item) {\r\n result.push(delim, item); \r\n return result;\r\n }, []).slice(1);\r\n}\r\n\r\nfunction spreadArrayTailSlice(array, delim) {\r\n return array.reduce(function (result, item) {\r\n result.push(delim, item);\r\n \r\n return result;\r\n }, []).slice(0, -1);\r\n}\r\n\r\nfunction spreadArraySlice2(array, delim) {\r\n return array.slice(1).reduce(function (result, item) {\r\n result.push(delim, item); \r\n return result;\r\n }, []);\r\n}\r\n\r\n\r\nfunction spreadArrayFor(arr, delim) {\r\n var result = [];\r\n for (var i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n \tresult.push(arr[i], delim);\r\n };\r\n result.pop();\r\n return result;\r\n}\r\n\r\nfunction spreadArrayForReverse(arr, delim) {\r\n var result = []\r\n for (var i = arr.length - 1; i \u003E= 0; i--) {\r\n result.unshift(arr[i], delim);\r\n };\r\n result.pop();\r\n return result;\r\n}\r\n\r\nfunction spreadArrayForComparison(arr, delim) {\r\n var result = [];\r\n for (var i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n \tif (i === 0) {\r\n result.push(arr[i]);\r\n } else {\r\n result.push(delim, arr[i]);\r\n }\r\n };\r\n return result;\r\n}\r\n\r\nfunction spreadArrayForWithInit(arr, delim) {\r\n var result = [arr[0]]\r\n for (var i = 1; i \u003C arr.length; i\u002B\u002B) { \t\r\n result.push(delim, arr[i]);\r\n };\r\n return result;\r\n}\r\n","TestCases":[{"Name":"ComparisonAndConcat","Code":"spreadArrayComparisonAndConcat(testArray, delim);","IsDeferred":false},{"Name":"Concat","Code":"spreadArrayConcat(testArray, delim);","IsDeferred":false},{"Name":"Comparison","Code":"spreadArrayComparison(testArray, delim);","IsDeferred":false},{"Name":"Pop","Code":"spreadArrayPop(testArray, delim);","IsDeferred":false},{"Name":"Shift","Code":"spreadArrayShift(testArray, delim);","IsDeferred":false},{"Name":"Slice","Code":"spreadArraySlice(testArray, delim);","IsDeferred":false},{"Name":"TailSlice","Code":"spreadArrayTailSlice(testArray, delim);","IsDeferred":false},{"Name":"Slice2","Code":"spreadArraySlice2(testArray, delim);","IsDeferred":false},{"Name":"For","Code":"spreadArrayFor(testArray, delim);","IsDeferred":false},{"Name":"ForReverse","Code":"spreadArrayForReverse(testArray, delim);","IsDeferred":false},{"Name":"ForComparison","Code":"spreadArrayForComparison(testArray, delim);","IsDeferred":false},{"Name":"ForWithInit","Code":"spreadArrayForWithInit(testArray, delim);","IsDeferred":false},{"Name":"spreadArrayComparisonArrow","Code":"spreadArrayComparisonArrow(testArray, delim);","IsDeferred":false}]}