group(callback, thisp?, equals?)

Returns an array of [key, class] entries where every value from the collection is placed into the same equivalence class if they return the same key through the given callback.

The given callback receives the value for each entry, the key or index, and the collection itself.

On collections

Usage

  • group(callback)
  • group(callback, thisp)
  • group(callback, thisp, equals)

Related

  • reduce(callback, basis)

    Aggregates every value in this collection with the result collected up to that index.

  • forEach(callback, thisp?)

    Calls the callback for each entry in the collection.

  • map(callback, thisp?)

    Returns an array of the respective return values of a callback for each entry in this collection.

  • filter(callback, thisp?)

    Returns an array with each value from this collection that passes the given test.

  • group(callback, thisp?, equals?)

    Returns an array of [key, class] entries where every value from the collection is placed into the same equivalence class if they return the same key through the given callback.