isArrayEqual()function
isArrayEqual(left: ImmutableArray, right: T, recursor: Match = isEqual): left is T
| Param | Type | |
|---|---|---|
left | ImmutableArray | The array to check and narrow. required |
right | T | The array to compare against. required |
recursor | Match | Function that checks each item of the array. - Defaults to isEqual() to check strict equality of the items.- Use isDeepEqual() as the recursor to check to check deep equality of the items. Defaults to isEqual |
| Return | |
|---|---|
left is T | true if both arrays have the same length and matching items. |
Are two arrays equal based on their items?
Examples
isArrayEqual([1, 2], [1, 2]) // true