Example 1 — Even Split
When the count divides evenly, every chunk has the same length.
_.chunk([1, 2, 3, 4, 5, 6], 2);
// → [[1, 2], [3, 4], [5, 6]] How It Works
- Source. Six numbers; indexes
0…5. - First group. Length
2takes1and2. - Next groups. Same step for
3,4then5,6. - Even fit. No remainder — three chunks of length
2.

