Hex Core JS
    Preparing search index...

    Function inGroups

    • Splits the given array into the specified number of sub-arrays as evenly as possible. If the given array cannot be evenly split into the specified number of groups, then the first sub-arrays will be longer than the last sub-arrays.

      Type Parameters

      • T

      Parameters

      • array: T[]

        The array to split.

      • numGroups: number

        The number of groups to split the array into.

      Returns T[][]