| [a762898] | 1 | /**
|
|---|
| 2 | * Checks if a specified value exists within a given array-like collection.
|
|---|
| 3 | *
|
|---|
| 4 | * The comparison uses SameValueZero to check for inclusion.
|
|---|
| 5 | *
|
|---|
| 6 | * @template T The type of elements in the collection
|
|---|
| 7 | * @param collection The array-like collection to search in
|
|---|
| 8 | * @param target The value to search for in the collection
|
|---|
| 9 | * @param [fromIndex=0] The index to start searching from. If negative, it is treated as an offset from the end
|
|---|
| 10 | * @returns `true` if the value is found in the collection, `false` otherwise
|
|---|
| 11 | *
|
|---|
| 12 | * @example
|
|---|
| 13 | * includes([1, 2, 3], 2); // true
|
|---|
| 14 | * includes([1, 2, 3], 4); // false
|
|---|
| 15 | * includes('hello', 'e'); // true
|
|---|
| 16 | * includes(null, 1); // false
|
|---|
| 17 | * includes([1, 2, 3], 2, 2); // false
|
|---|
| 18 | * includes([1, 2, 3], 2, -2); // true
|
|---|
| 19 | */
|
|---|
| 20 | declare function includes<T>(collection: Record<string, T> | Record<number, T> | null | undefined, target: T, fromIndex?: number): boolean;
|
|---|
| 21 |
|
|---|
| 22 | export { includes };
|
|---|