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

    Function getLast

    • Returns the last element of the given array

      Type Parameters

      • E

      Parameters

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

        the array to inspect

      • OptionaldefaultValue: null | E

        the default value if the array is empty

      Returns undefined | null | E

      the last element of the given array

      David Hsing

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