Function groupByMap

  • Similar to groupBy but it returns a Map object with the results.

    Returns

    Returns the aggregated map object.

    Example

    groupByMap([6.1, 4.2, 6.3], Math.floor)
    // Map { 4: [4.2], 6: [6.1, 6.3] }

    // The `property` iteratee shorthand.
    groupByMap(['one', 'two', 'three'], 'length')
    // Map { 3: ['one', 'two'], 5: ['three'] }

    Type Parameters

    • V

    Parameters

    • arr: Iterable<V>

      The collection to iterate over.

    • fn: Iteratee<V, any, any>

    Returns Map<any, V[]>

  • Type Parameters

    • V

    Parameters

    • arr: Iterable<V>
    • fn: PropertyKey

    Returns Map<any, V[]>

  • Type Parameters

    • V

    Parameters

    • arr: Object
    • fn: Iteratee<V, any, any>

    Returns Map<any, V[]>

  • Type Parameters

    • V

    Parameters

    • arr: Object
    • fn: PropertyKey

    Returns Map<any, V[]>

Generated using TypeDoc