function chunkArray(array, size) { let result3 = []; for (let i = 0; i < array.length; i += size) { let chunk = array.slice(i, i + size); result3.push(chunk); } return result3;}console.log(chunkArray([1, 2, 3, 4, 5, 6, 7, 8], 3));
Standard input is empty
Standard output is empty
Error: near line 1: near "function": syntax error Error: near line 3: near "for": syntax error Error: near line 5: near "result3": syntax error Error: near line 6: unrecognized token: "}" Error: near line 8: unrecognized token: "}"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!