Function map

  • Array mapping.

    Type Parameters

    • T

    • R

    • Context

    Parameters

    • arr: readonly T[]
    • cb: ((this, val, index?, arr?) => R)
        • (this, val, index?, arr?): R
        • Parameters

          • this: Context
          • val: T
          • Optional index: number
          • Optional arr: readonly T[]

          Returns R

    • Optional context: Context

    Returns R[]

    Must be an array.

    Typeparam

    T Type in Array

    Typeparam

    R Type Returned