• Adds a new item to the start of an array, or returns a new array if list is null or undefined.

    Same as [x, ...list].

    Type Parameters

    • T

    Parameters

    • x: T

    Returns (<U>(list) => (T | U)[])

      • <U>(list): (T | U)[]
      • Type Parameters

        • U

        Parameters

        • list: U[]

        Returns (T | U)[]

    Example

    prepend(0)([3, 6, 9])
    // => [0, 3, 6, 9]

    prepend(0)(undefined)
    // => [0]

Generated using TypeDoc