{"ScriptPreparationCode":"var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];","TestCases":[{"Name":"slice","Code":"/*\r\nfunction* getBatch(records, chunksize = 10) {\r\n while (records.length) {\r\n yield records.splice(0, chunksize);\r\n }\r\n}\r\n*/\r\n\r\nlet chunksize = 10;\r\nlet pos = 0;\r\nlet chunk = [];\r\n\r\nwhile (pos \u003C= data.length) {\r\n\tchunk = data.slice(pos, pos \u002B chunksize);\r\n \tconsole.log(chunk);\r\n pos = pos \u002B chunksize;\r\n}\r\n","IsDeferred":false},{"Name":"push","Code":"let chunksize = 10;\r\nlet pos = 0;\r\nlet chunk = [];\r\n\r\nfor (let pos = 0; pos \u003C= data.length; pos\u002B\u002B) {\r\n chunk.push(data[pos]);\r\n \r\n if (pos % chunksize === 0 || pos === data.length) {\r\n \tconsole.log(chunk);\r\n chunk = [];\r\n }\r\n}\r\n ","IsDeferred":false}]}