@jiway/firestorm-core - v1.1.1
    Preparing search index...

    Function groupBy

    • Splits the array into subgroups

      It is O(n) in complexity.

      Type Parameters

      • T

        Type of the items in the array

      • K

        Type of the key, it must be a base type.

      Parameters

      • sourceArray: T[]

        Array to split

      • extractKeyFn: (item: T) => K

        The function that gives the key of the group of an item

      Returns Map<K, T[]>

      A map of the items grouped by their extracted key.