I am facing an issue with two objects that I am trying to store in an associative array. When I assign values to them, all the values are stored incorrectly, except for the last one.
Can someone please help me figure out what I am doing wrong?
var usrMrid = {name: "mrid"};
var usrXYZZ = {name: "xyzz"};
var comm = {};
comm[usrMrid] = "ONE";
comm[usrXYZZ] = "TWO";
console.log("usrMrid: " + comm[usrMrid]); // this gives TWO, when it should give ONE
console.log("usrXYZZ: " + comm[usrXYZZ]); // this works fine