Files
lodash/_arrayIncludes.js
John-David Dalton 7293d39642 Bump to v4.1.0.
2016-01-29 01:14:13 -08:00

18 lines
506 B
JavaScript

define(['./_baseIndexOf'], function(baseIndexOf) {
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} array The array to search.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
return !!array.length && baseIndexOf(array, value, 0) > -1;
}
return arrayIncludes;
});