首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JS-二

2013-11-08 
JS-2JS还是有些奇怪的东西的 也不知道怎么去看源码 才能知道这奇怪的来源?var obj {}var otherObj {n

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);
?

热点排行