var a = {};
var b = {key: "b"};
var c = {key: "c"};
var d = [3,5,6];
a[b] = 123;
a[c] = 345;
a[d] = 333;
console.log(a[b]); // 345
console.log(a[c]); // 345
console.log(a[d]); // 333
Why do both a [b] and a [c] output 345? what is the principle?