Test whether any value in an iterable satisfies a predicate.
true if any value passes the test, false otherwise.
true
false
Iteration terminates on the first true predicate result.
Linear.
import { some } from '@lumino/algorithm';let data = [5, 7, 1];some(data, value => value === 7); // truesome(data, value => value === 3); // false
The iterable object of interest.
The predicate function to invoke for each value.
Generated using TypeDoc
Test whether any value in an iterable satisfies a predicate.
Returns
trueif any value passes the test,falseotherwise.Notes
Iteration terminates on the first
truepredicate result.Complexity
Linear.
Example