{"ScriptPreparationCode":"var _list = [];\r\nfor (var i = 0; i \u003C 1000 * 1000; i\u002B\u002B) {\r\n _list.push(i);\r\n}\r\nvar chunkR = (array, size) =\u003E array.length ? [array.splice(0,size), ...chunkR(array, size)]:[]\r\nvar chunkW = (array, size) =\u003E {\r\n const R = new Array(Math.ceil(array.length / size))\r\n while (array.length)\r\n R.push(array.splice(0, size))\r\n return R\r\n}\r\n\r\n// lodash shit \r\nfunction slice(array, start, end) {\r\n let length = array == null ? 0 : array.length\r\n if (!length) {\r\n return []\r\n }\r\n start = start == null ? 0 : start\r\n end = end === undefined ? length : end\r\n\r\n if (start \u003C 0) {\r\n start = -start \u003E length ? 0 : (length \u002B start)\r\n }\r\n end = end \u003E length ? length : end\r\n if (end \u003C 0) {\r\n end \u002B= length\r\n }\r\n length = start \u003E end ? 0 : ((end - start) \u003E\u003E\u003E 0)\r\n start \u003E\u003E\u003E= 0\r\n\r\n let index = -1\r\n const result = new Array(length)\r\n while (\u002B\u002Bindex \u003C length) {\r\n result[index] = array[index \u002B start]\r\n }\r\n return result\r\n}\r\nfunction toInteger(value) {\r\n const result = (value)\r\n const remainder = result % 1\r\n\r\n return remainder ? result - remainder : result\r\n}\r\n\r\n\r\nfunction chunkL(array, size = 1) {\r\n size = Math.max(toInteger(size), 0)\r\n const length = array == null ? 0 : array.length\r\n if (!length || size \u003C 1) {\r\n return []\r\n }\r\n let index = 0\r\n let resIndex = 0\r\n const result = new Array(Math.ceil(length / size))\r\n\r\n while (index \u003C length) {\r\n result[resIndex\u002B\u002B] = slice(array, index, (index \u002B= size))\r\n }\r\n return result\r\n}\r\nvar list = [..._list]\r\n","TestCases":[{"Name":"splice Recurcive","Code":"const list = [..._list]\r\nconst c = chunkR(list, 200)\r\nif (c.length != 5000) throw new Error(\u0027bad result\u0027)","IsDeferred":false},{"Name":"splice While","Code":"const list = [..._list]\r\nconst c = chunkL(list, 200)\r\nif (c.length != 5000) throw new Error(\u0027bad result\u0027)","IsDeferred":false},{"Name":"lodash chunk","Code":"const list = [..._list]\r\nconst c = chunkL(list, 200)\r\nif (c.length != 5000) throw new Error(\u0027bad result\u0027)","IsDeferred":false}]}