@unikue/ts-lang-utils
    Preparing search index...

    Function getLast

    • Returns the last element of the given array

      Type Parameters

      • E

      Parameters

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

        The array to inspect

      • OptionaldefaultValue: E | null

        The default value if the array is empty

      Returns E | null | undefined

      the last element of the given array

      David Hsing

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