isDeepEqual()function

isDeepEqual(left: unknown, right: T): left is T
ParamType
leftunknown
The value to check and narrow. required
rightT
The value to compare against. required
Return
left is T
true if the values are deeply equal.

Are two unknown values deeply equal?

  • If the values are both arrays/objects, see if the items/properties are deeply equal with each other.

Examples

isDeepEqual({ a: { b: 1 } }, { a: { b: 1 } }) // true