ezyVet Javascript Helper Library Documentation
    Preparing search index...

    Function groupBy

    • 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: object) => string)

      Returns Record<string, T[]>

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