You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both compares return false. This is because in JavaScript we pass non primitive data types by reference. So, say:
{id:1} == {id:1} // returns false even though is shallow compare, we are not comparing here two objects values, but 2 references, which are different.
The text was updated successfully, but these errors were encountered:
@ganqqwerty I came here to create this issue but found there is already a ticket for it. Is this question relevant? Because if we need to shallow copy, can't we just assign it?
Eg: var object1 = {a: 1}; var object2 = object1;
Both compares return false. This is because in JavaScript we pass non primitive data types by reference. So, say:
{id:1} == {id:1} // returns false even though is shallow compare, we are not comparing here two objects values, but 2 references, which are different.
The text was updated successfully, but these errors were encountered: