blob: 3737a6d9eb057de623038cf1d7fda3b1bcf9b444 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var baseIndexOf = require('./_baseIndexOf');
2
3/**
4 * A specialized version of `_.includes` for arrays without support for
5 * specifying an index to search from.
6 *
7 * @private
8 * @param {Array} [array] The array to inspect.
9 * @param {*} target The value to search for.
10 * @returns {boolean} Returns `true` if `target` is found, else `false`.
11 */
12function arrayIncludes(array, value) {
13 var length = array == null ? 0 : array.length;
14 return !!length && baseIndexOf(array, value, 0) > -1;
15}
16
17module.exports = arrayIncludes;