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

    Function firstNotEmpty

    • Returns the first not empty 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 empty element in the given array, or null if all elements are nil

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