isShallowEqual()function
isShallowEqual(left: unknown, right: T): left is T
| Param | Type | |
|---|---|---|
left | unknown | The value to check and narrow. required |
right | T | The value to compare against. required |
| Return | |
|---|---|
left is T | true if the values are shallowly equal. |
Are two unknown values shallowly equal?
- If the values are both arrays/objects, see if the items/properties are shallowly equal with each other.
Examples
isShallowEqual({ a: 1 }, { a: 1 }) // true