Test whether all values in an iterable satisfy a predicate.
true if all values pass the test, false otherwise.
true
false
Iteration terminates on the first false predicate result.
Linear.
import { every } from '@lumino/algorithm';let data = [5, 7, 1];every(data, value => value % 2 === 0); // falseevery(data, value => value % 2 === 1); // true
The iterable object of interest.
The predicate function to invoke for each value.
Generated using TypeDoc
Test whether all values in an iterable satisfy a predicate.
Returns
trueif all values pass the test,falseotherwise.Notes
Iteration terminates on the first
falsepredicate result.Complexity
Linear.
Example