I have seen this question being asked multiple times but I have a specific example to clarify.
var a = {animal: 'cat'};
var b = a;
a.animal = 'bear';
Here, I see b.animal will give an output "bear". Why is that? And how do I retain the original reference "cat" for variable b?