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

    Function firstNotNil

    • Returns the first not nil element in the given array, or null if all elements are nil

      Parameters

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

        The array to check

      Returns any

      the first not nil element in the given array, or null if all elements are nil

      firstNotNil([null, undefined, 'foo', 'bar', {}]);    // 'foo'