docs:programming:javascript:loops

Loops

for (var i = 0; i < someArray.length; i++){
	// do something
}
  • 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.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1