Open Enzaik opened 5 years ago
you are totally right, this question is misleading. Will remove it.
Anyway, the guide is very good 😊 congrats!
@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.