javascript循环遍历数组输出key value

javascript循环遍历数组输出key value
用$.each方法肯定不行的 所以采用如下方法
<pre>

markers = [];
markers[2]=3;
markers[3]=7;
for(var key in markers){
console.log( key )
console.log( markers[key] )
}
</pre>

猜你喜欢

转载自www.cnblogs.com/newmiracle/p/11865583.html
今日推荐