for

Executes a loop so that while expressionA is true, executes statementA and then evaluates expression B, then executes statementB if expressionB is true.

Syntax

for ([expressionA]; [statementA]; [expressionB]) {statementB}

Example

for (var i = 0; i < 10; i++) {
	document.write(i); //writes the value of "i" until it reaches 10.
	} 

Remarks

Use as a counter or as an easy way to loop through an array-like structure.

text_javascript aptana_docs