• Returns the first element of the given array

    Type Parameters

    • E

    Parameters

    • Optionalarray: null | E[] | readonly E[]

      the array to inspect

    Returns E | undefined

    the first element of the given array

    getFirst(['foo', 'bar']);    // 'foo'