* Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as
(collection, value, fromIndex, guard)
| 9528 | * // => true |
| 9529 | */ |
| 9530 | function includes(collection, value, fromIndex, guard) { |
| 9531 | collection = isArrayLike(collection) ? collection : values(collection); |
| 9532 | fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; |
| 9533 | |
| 9534 | var length = collection.length; |
| 9535 | if (fromIndex < 0) { |
| 9536 | fromIndex = nativeMax(length + fromIndex, 0); |
| 9537 | } |
| 9538 | return isString(collection) |
| 9539 | ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) |
| 9540 | : (!!length && baseIndexOf(collection, value, fromIndex) > -1); |
| 9541 | } |
| 9542 | |
| 9543 | /** |
| 9544 | * Invokes the method at `path` of each element in `collection`, returning |
no test coverage detected