Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • Array

Index

Methods

Methods

flat

  • flat<U>(this: U[][][][][][][][], depth: 7): U[]
  • flat<U>(this: U[][][][][][][], depth: 6): U[]
  • flat<U>(this: U[][][][][][], depth: 5): U[]
  • flat<U>(this: U[][][][][], depth: 4): U[]
  • flat<U>(this: U[][][][], depth: 3): U[]
  • flat<U>(this: U[][][], depth: 2): U[]
  • flat<U>(this: U[][], depth?: undefined | 1): U[]
  • flat<U>(this: U[], depth: 0): U[]
  • flat<U>(depth?: undefined | number): any[]
  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][][][][][][]
    • depth: 7

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][][][][][]
    • depth: 6

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][][][][]
    • depth: 5

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][][][]
    • depth: 4

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][][]
    • depth: 3

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][][]
    • depth: 2

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[][]
    • Optional depth: undefined | 1

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    Type parameters

    • U

    Parameters

    • this: U[]
    • depth: 0

      The maximum recursion depth

    Returns U[]

  • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth. If no depth is provided, flat method defaults to the depth of 1.

    Type parameters

    • U

    Parameters

    • Optional depth: undefined | number

      The maximum recursion depth

    Returns any[]

flatMap

  • flatMap<U, This>(callback: function, thisArg?: This): U[]
  • Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.

    Type parameters

    • U

    • This

    Parameters

    • callback: function

      A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.

        • (this: This, value: T, index: number, array: T[]): U | ReadonlyArray<U>
        • Parameters

          • this: This
          • value: T
          • index: number
          • array: T[]

          Returns U | ReadonlyArray<U>

    • Optional thisArg: This

      An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.

    Returns U[]

Generated using TypeDoc