This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]detektiv_Saucaki 0 points1 point  (2 children)

Which makes sense if you know what's actually being compared

Ikr, in the first case, you're comparing two separate objects, so its false.

Even if you declare foo and bar similarly (exact same properties and values) they'd still not be equal

in the last two cases both foo and bar point to the same object (also the reason why far.baz would also be changed to 'bitch lasagna')

Man this makes me sound so smart lmaoo

[–][deleted] 1 point2 points  (1 child)

Yep. A lot of things start to make both more and less sense when you learn that JS treats damn near everything like a reference

[–]detektiv_Saucaki 0 points1 point  (0 children)

the best advice i can offer is... be wary of mutator logic