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 a collection contains at least n
elements which pass a test implemented by a predicate function, iterating from right to left.
The predicate function is provided three arguments:
value
: collection valueindex
: collection indexcollection
: the input collectionThe function immediately returns upon finding n
successful elements.
If provided an empty collection, the function returns false
.
input collection
number of elements
test function
execution context
boolean indicating whether a collection contains at least n
elements which pass a test
function isNegative( v ) {
return ( v < 0 );
}
var arr = [ -1, 1, -2, 3, 4 ];
var bool = someByRight( arr, 2, isNegative );
// 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