Files
lodash/_arrayIncludesWith.js
John-David Dalton 8166b65853 Bump to v4.6.0.
2016-02-29 23:38:21 -08:00

26 lines
651 B
JavaScript

define([], function() {
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to search.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
return arrayIncludesWith;
});