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

    Function getFirst

    • Returns the first 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 first element of the given array

      David Hsing

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