var mapObject = {
id1001: '小明',
id1002: '小花'
}
获取id是‘id001’对应的值:
for(var key in mapObject){
var value = mapObject[ key ]; //注意是 [ ]
alert(value); //依次弹出小明、小花
}
var mapObject = {
id1001: '小明',
id1002: '小花'
}
获取id是‘id001’对应的值:
for(var key in mapObject){
var value = mapObject[ key ]; //注意是 [ ]
alert(value); //依次弹出小明、小花
}