src/immutable-lodash.js
function chunk(iterable, size=1) {
  let current = 0
  if (_.isEmpty(iterable)) {
    return iterable
  }
  let result = List()
  while (current < iterable.size) {
    result = result.push(iterable.slice(current, current + size))
    current += size
  }
  return result
}
function chunk(iterable, size=1) {
  let current = 0
  if (_.isEmpty(iterable)) {
    return iterable
  }
  let result = List()
  while (current < iterable.size) {
    result = result.push(iterable.slice(current, current + size))
    current += size
  }
  return result
}
function chunk ( iterable , size = 1 ) { let current = 0 if ( _ . isEmpty ( iterable ) ) { return iterable } let result = List ( ) while ( current < iterable . size ) { result = result . push ( iterable . slice ( current , current + size ) ) current += size } return result }
Creates an iterable of elements split into groups the length of `size`.
If `iterable` can't be split evenly, the final chunk will be the remaining
elements.

@static
@memberOf _
@category Iterable
@param {Iterable} iterable The iterable to process.
@param {number} [size=1] The length of each chunk
@returns {Iterable} Returns the new iterable of chunks.
@example

let list = ['a', 'b', 'c', 'd']
_.chunk(list, 2)
// => [['a', 'b'], ['c', 'd']]

_.chunk(list, 3)
// => [['a', 'b', 'c'], ['d']]
Creates an iterable of elements split into groups the length of size . If iterable can t be split evenly the final chunk will be the remaining elements .