Determines whether all elements of a sequence satisfy a condition.
An Enumerable that contains the elements to apply the predicate to.
A function to test each element for a condition.
true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
IEnumerable.all for fluent syntax.
const numbers = [1, 2, 3, 4];const areAllNumbersEven = all(numbers, x => x % 2 === 0); Copy
const numbers = [1, 2, 3, 4];const areAllNumbersEven = all(numbers, x => x % 2 === 0);
Determines whether all elements of a sequence satisfy a condition.