Open dermellor opened 9 years ago
I think it's somewhat by design, the way chunk handles empty array with padding is like this:
_.chunk([], 3, '-') // => ['-'], maybe this should be []?
In your case, the leftover part after splitting is [], so you get ['-']. The current implementation of chunk actually needs clients check the length of array and chunk size beforehand, quite inconvenient. I'm not sure, need someone with more knowledge on this.
The following statement
returns an array with 5 arrays, where the last one contains one item with the padding ("-"). This is obviously incorrect.