• Returns the last item in an array, or the fallback if list is null or undefined.

    Type Parameters

    • T

    Parameters

    • fallback: T

    Returns ((list) => T)

      • (list): T
      • Parameters

        • list: T[]

        Returns T

    Example

    last(99)([3, 6, 9])
    // => 9

    last(99)(undefined)
    // => 99

Generated using TypeDoc