Function some

  • Checks if predicate returns truthy for any element of array. Iteration is stopped once predicate returns truthy. The predicate is invoked with three arguments: (value, index, array).

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to iterate over.

    • predicate: ListIterator<T, boolean>

      The function invoked per iteration.

    Returns boolean

    Returns true if any element passes the predicate check, else false.

    5.0.0

    some([null, 0, 'yes', false], Boolean)
    // => true