1 var baseIndexOf = require(
'./_baseIndexOf'),
2 isArrayLike = require(
'./isArrayLike'),
3 isString = require(
'./isString'),
4 toInteger = require(
'./toInteger'),
5 values = require(
'./values');
8 var nativeMax = Math.max;
40 function includes(collection, value, fromIndex, guard) {
41 collection = isArrayLike(collection) ? collection : values(collection);
42 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
44 var length = collection.length;
46 fromIndex = nativeMax(length + fromIndex, 0);
48 return isString(collection)
49 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
50 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
53 module.exports = includes;