equalsDeep
Recursive structural array equality.
Two arrays are equal when they have the same length and each pair of elements at the same index is structurally equal:
- Arrays recurse with
equalsDeep. - Plain objects recurse key-by-key with structural comparison.
Dateinstances are compared by their epoch value.- All other values use strict equality (
===), which meansNaN !== NaNand special objects (Map, Set, RegExp, Promise, class instances\u2026) are compared by reference.
For positional one-level comparison use equalsShallow. For order-independent comparison use equalsUnordered.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
arrA | readonly T[] | First array to compare |
arrB | readonly T[] | Second array to compare |
Returns
Section titled “Returns”boolean — true if arrays are deeply equal, false otherwise.
Examples
Section titled “Examples”Compare nested arrays
Section titled “Compare nested arrays”Deeply compares two arrays including nested structures.
Detect nested differences
Section titled “Detect nested differences”Returns false when nested arrays differ.
