<html>
<head>
<script>
window.onload=function(){
var items= [
{name: ‘Tony‘,
age: 54
},
{ name: ‘Yuk‘,
age: 52
},
{name: ‘Jamo‘,
age: 65
}
];
var item=new Array();
for(var key in items){
item.push(items[key][‘name‘]);
}
alert(item);
}
</script>
</head>
<body>
</body>
</html>
每日练习之javascript循环,布布扣,bubuko.com
原文:http://my.oschina.net/guomingliang/blog/299667