Checks whether an element in a collection passes a test.
Checks whether an element in a collection passes a test.
Checks whether an element in a collection passes a test.
Checks whether an element in a collection passes a test.
Tests whether all elements in a collection pass a test implemented by a predicate function.
The predicate function is provided three arguments:
value
: collection valueindex
: collection indexcollection
: the input collectionThe function immediately returns upon encountering a non-truthy return value.
If provided an empty collection, the function returns true
.
input collection
test function
execution context
boolean indicating whether all elements pass a test
function isPositive( v ) {
return ( v > 0 );
}
var arr = [ 1, 2, 3, 4 ];
var bool = everyBy( arr, isPositive );
// returns true
Checks whether an element in a collection passes a test.
collection value
collection index
boolean indicating whether an element in a collection passes a test