Loops
for
for (var i = 0; i < someArray.length; i++){ // do something }
for/in
- for/in is used to loop through all properties of an object, NOT an array
for (var x in someObject){ document.write(x + " is " + someObject[x] + "\n"); }
docs:programming:javascript:loops
for (var i = 0; i < someArray.length; i++){ // do something }
for (var x in someObject){ document.write(x + " is " + someObject[x] + "\n"); }