JS-2
JS还是有些奇怪的东西的 也不知道怎么去看源码 才能知道这奇怪的来源
?
var obj = {};var otherObj = { name: "other"};var map = {};map[obj] = 'first';map[otherObj] = 'second';map[obj]; // This is 'second'.// Recall that object keys are strings. The string// generated by an object is '[object Object]' by default.// So, obj and otherObj have the same key; // map[obj] and map[otherObj] are therefore equivalent.console.log(obj.toString);console.log(otherObj.toString);?