This is what i use, it might not be super fast, but it is compact and simple:
let chunksplit = (stream, size) => stream.reduce((chunks, item, idx, arr) => (idx % size == 0) ? [...chunks, arr.slice(idx, idx + size)] : chunks, []);_x000D_
//if the index is a multiple of the chunksize, add new array_x000D_
_x000D_
let testArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22];_x000D_
_x000D_
document.write(JSON.stringify( chunksplit(testArray, 5) ));_x000D_
//using JSON.stringify for the nested arrays to be shown
_x000D_