• groupBy - Creates an object composed of keys generated from the results of running each element of array thru getKey

    Type Parameters

    • T

    Parameters

    • array: T[]
    • getGroupKey: string | ((o) => string)

    Returns Record<string, T[]>

    Example

    groupBy(['one', 'two', 'three'], 'length');
    // return { '3': ['one', 'two'], '5': ['three'] }

Generated using TypeDoc