javascript loop through the array output key value

javascript loop through the array output key value
certainly not so using a method of a method of .each $
<pre>

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

Guess you like

Origin www.cnblogs.com/newmiracle/p/11865583.html