var someArray = ['one', 'two', 'three'];
for ( var i in someArray ) {
console.log( someArray[i] );
}
</code></pre>
JSON Array
var someArray = [ {'id': 1, 'name': 'foo'}, {'id': 2, 'name': 'bar'} ];
for ( var i in someArray ) {
console.log( someArray[i].id );
console.log( someArray[i].name );
}
</code></pre>
This works all the time:
JS Array