I want to understand this concept which confuses me.
suppose I have the below logic:
function test(){
var jsonObj_1 = {};
var jsonObj_2 = {};
jsonObj_2 = jsonObj_1;
jsonObj_2.myKey = 3;
console.log(jsonObj_2) // result => {myKey:3}
console.log(jsonObj_1) // result => {myKey:3}
}
my question is why jsonObj_1 is equal to {myKey:3} when it's never get assigned?!