Executes a statement until a specified condition is false.
while (expression) statements
The while statement checks expression before a loop is first executed. If expression is false at this time, the loop is never executed.
The following example illustrates the use of the while statement.
function BreakTest(breakpoint){
var i = 0;
while (i < 100)
{
if (i == breakpoint)
break;
i++;
}
return(i);
}
break Statement | continue Statement | do...while Statement | for Statement | for...in Statement