* Checks if `value` is in `collection` using `SameValueZero` for equality * comparisons. If `fromIndex` is negative, it is used as the offset from * the end of `collection`. * * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
(collection, target, fromIndex, guard)
| 8029 | * // => true |
| 8030 | */ |
| 8031 | function includes(collection, target, fromIndex, guard) { |
| 8032 | var length = collection ? getLength(collection) : 0; |
| 8033 | if (!isLength(length)) { |
| 8034 | collection = values(collection); |
| 8035 | length = collection.length; |
| 8036 | } |
| 8037 | if (!length) { |
| 8038 | return false; |
| 8039 | } |
| 8040 | if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { |
| 8041 | fromIndex = 0; |
| 8042 | } else { |
| 8043 | fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); |
| 8044 | } |
| 8045 | return (typeof collection == 'string' || !isArray(collection) && isString(collection)) |
| 8046 | ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) |
| 8047 | : (getIndexOf(collection, target, fromIndex) > -1); |
| 8048 | } |
| 8049 | |
| 8050 | /** |
| 8051 | * Creates an object composed of keys generated from the results of running |
nothing calls this directly
no test coverage detected