Question: Case 1 . If two values are primitive and are strictly equal, then they are deep equal. Case 2 : If two values are primitive
Case If two values are primitive and are strictly equal, then they are deep equal.
Case : If two values are primitive and are not strictly equal, then they are not deep equal.
Case If one value is an object and the other value is primitive, then they are not deep equal.
Case : If two values are both objects and are strictly equal, then they are deep equal.
Case : If two values are both objects and are not strictly equal, then we determine deep equality as follows:
If both values are nonarray objects, then they are deep equal if both the objects have exactly the same properties and the values of these properties are deep equal. The order of properties in these nonarray objects doesn't matter for deep equality.
If both values are arrays, then they are deep equal if their elements are deep equal and these elements are in the same order.
All other pairs of objects are not deep equal.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
