Checks if predicate returns truthy for all elements of array. Iteration is stopped once predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).
predicate
array
Note: This method returns true for empty arrays because everything is true of elements of empty arrays.
true
The array to iterate over.
The function invoked per iteration.
Returns true if all elements pass the predicate check, else false.
false
5.0.0
every([true, 1, null, 'yes'], Boolean)// => false Copy
every([true, 1, null, 'yes'], Boolean)// => false
Checks if
predicate
returns truthy for all elements ofarray
. Iteration is stopped oncepredicate
returns falsey. The predicate is invoked with three arguments: (value, index, array).Note: This method returns
true
for empty arrays because everything is true of elements of empty arrays.