Following up on @ver-greeneyes response with the latest Object.groupBy static function:
function chunkArray(array, perChunk) { return Object.values(Object.groupBy(array, (_, i) => i / perChunk | 0)); }