ITeye博客

javascript遍历map

zwh910621 · 2011-09-14 13:46 · javascript · Web前端 · Markdown

"semanticsMap":{"0":{"type":0,"semanticsID":1,"cotent":null},"1":{"type":0,"semanticsID":1,"cotent":null}}

for(var key in semanticsMap){
	alert(semanticsMap[key].semanticsID);

}

 

var testMap={"key1":"value1","key2":"value2","key3":new Array("one","two","three")};

for(var key in testMap){

alert(“testMap[”+key+"]="+testMap[key]);

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。