Thursday, January 1, 2009

While Loop

The JavaScript while loop consists of a condition and the statement block.

while (condition)
{
...statements...
}


The condition is evaluated. If the condition is true the statements are evaluated. If the statement is false we exit from the while loop.

Let us take a simple example below that prints the number from 0 to 10.
http://www.referencedesigner.com/tutorials/js/js_11.php

No comments: