Function: equal()
equal<
ElementType>(iterable:IterableResolvable<ElementType>,other:IterableResolvable<ElementType>):boolean
Defined in: projects/utilities/packages/iterator-utilities/src/lib/equal.ts:25
Determines if the elements of both iterators are equal.
Type Parameters
| Type Parameter | 
|---|
| ElementType | 
Parameters
| Parameter | Type | Description | 
|---|---|---|
| iterable | IterableResolvable<ElementType> | The iterator to compare. | 
| other | IterableResolvable<ElementType> | The iterator to compare against. | 
Returns
boolean
Whether the two iterators are equal.
Example
import { equal } from '@sapphire/iterator-utilities';
console.log(equal([1], [1]));
// Output: true
console.log(equal([1], [1, 2]));
// Output: false
Remarks
This function consumes the entire iterator.