{"ScriptPreparationCode":"var testArray = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZ\u0027.split(\u0027\u0027);\r\nvar delim = {\u0027a\u0027: 1};\r\n\r\nfunction spreadArrayErtema(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 spreadArrayKbakba(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\n\r\nfunction spreadArrayComparsionAndConcat(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 spreadArrayComparsion(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}","TestCases":[{"Name":"spreadArray by ertema","Code":"spreadArrayErtema(testArray, delim);","IsDeferred":false},{"Name":"spreadArray by kbakba","Code":"spreadArrayKbakba(testArray, delim);","IsDeferred":false},{"Name":"spreadArray with comparsion and concat","Code":"spreadArrayComparsionAndConcat(testArray, delim);","IsDeferred":false},{"Name":"spreadArray with concat only","Code":"spreadArrayConcat(testArray, delim);","IsDeferred":false},{"Name":"spreadArray with comparsion only","Code":"spreadArrayComparsion(testArray, delim);","IsDeferred":false}]}