Javascript While Loops
While loop in javascript works same like for loop in javascript but in a little bit different manner. While loop runs until the condition is true and exits when the condition is false.
JavaScript Basics Examples:
You can see the live samples and examples of JavaScript Basics from the following links:
Syntax of JavaScript While loop
while (var<=value)
{
// code to be executed here;
}
Example of JavaScript while loop
var i=1;
while(i<=7)
{
document.write('<font size=\"' + i + '\">Hello World</font><br />');
i++;
}
Above example shows the use of while loop in JavaScript by executing a single line of code how you can increase the size of font in each loop by incrementing the value of variable i.
Output:
You can see the output of above discussed codes from the following link:
Continue to next tutorial: Javascript Do While to learn the alternate of using while loop in JavaScript.

* will not be published
* hint: http://www.example.com