mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
568 B
23 lines
568 B
10 years ago
|
/**
|
||
9 years ago
|
* A specialized version of `_.some` for arrays without support for iteratee
|
||
|
* shorthands.
|
||
10 years ago
|
*
|
||
|
* @private
|
||
|
* @param {Array} array The array to iterate over.
|
||
|
* @param {Function} predicate The function invoked per iteration.
|
||
9 years ago
|
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
|
||
10 years ago
|
*/
|
||
|
function arraySome(array, predicate) {
|
||
|
var index = -1,
|
||
|
length = array.length;
|
||
|
|
||
|
while (++index < length) {
|
||
|
if (predicate(array[index], index, array)) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
module.exports = arraySome;
|