Checks whether an element in a collection passes a test.
Function invoked for each collection element while a test condition is true.
Function invoked for each collection element while a test condition is true.
Checks whether an element in a collection passes a test.
Checks whether an element in a collection passes a test.
Function invoked for each collection element while a test condition is true.
Checks whether an element in a collection passes a test.
Function invoked for each collection element while a test condition is true.
Checks whether an element in a collection passes a test.
While a test condition is true, invokes a function once for each element in a collection.
The condition is evaluated after executing the function to invoke; thus, the provided function always executes at least once.
When invoked, both the predicate function and the function to apply are provided three arguments:
value
: collection valueindex
: collection indexcollection
: the input collectionIf provided an empty collection, the function invokes the provided function with the collection index set to undefined
.
input collection
function to invoke
function which indicates whether to continue iterating over a collection
execution context for the applied function
input collection
function predicate( v, index, collection ) {
return ( v === v );
}
function log( v, index, collection ) {
console.log( '%s: %d', index, v );
}
var arr = [ 1, 2, 3, 4, NaN, 5 ];
doWhileEach( arr, log, predicate );
Function invoked for each collection element while a test condition is true.
collection value
collection index