Splits an array into chunks of a specified size.
List of elements.
Length of each chunk to group.
list of grouped chunks
chunk([1, 2, 3, 4], 2);// [[1, 2], [3, 4]]chunk(['a', 'b', 'c'], 1);// [['a'], ['b'], ['c']] Copy
chunk([1, 2, 3, 4], 2);// [[1, 2], [3, 4]]chunk(['a', 'b', 'c'], 1);// [['a'], ['b'], ['c']]
Splits an array into chunks of a specified size.