The collection to inspect.
The value to search for.
Optional
fromIndex: numberThe index to search from.
@param- {Object} [guard] Enables use as an iteratee for methods like reduce
.
Optional
Optional
guard: anyOptional
Returns true
if value
is found, else false
.
5.12.0
includes([1, 2, 3], 1);
// => true
includes([1, 2, 3], 1, 2);
// => false
includes({ 'a': 1, 'b': 2 }, 1);
// => true
includes('abcd', 'bc');
// => true
Checks if
value
is incollection
. Ifcollection
is a string, it's checked for a substring ofvalue
, otherwiseSameValueZero
is used for equality comparisons. IffromIndex
is negative, it's used as the offset from the end ofcollection
.