JAVASCRIPT

 Home  Computers & Internet  Web Programming JAVASCRIPT
What is Javascript?
Javascript Placement
Syntax
Reserved Words
Variables
Data Types
Escaping Characters
Concatenation
Arithmetic Operators
Assignment Operators
Comparison Operators
Boolean Operators
Conditional Operator
If Statements
Else If Statements
If Else Statements
Switch Statements
While Loops
For Loops
Do While Loops
Break Statement
Continue Statement
prompt()
alert()
Date()
Event Handlers
String Object Methods
Math Object Methods
Window Object Methods

WHILE LOOPS IN JAVASCRIPT

A while loop in javascript tests a certain condition and as long as that condition evaluates to true, a block of code between the curly braces will continuously execute. Execution will stop only when the condition evaluates to false.

The general format is:

while(certain condition)
{
execute this code;
}

Example:

i=1;

while(i <= 10)
{
document.write("Bart Simpsonwas here.<br>");
i++;
}

The above code will output Bart Simpson was here. ten times and only stop when i is equal to 11.

Home | Privacy Policy | Terms Of Use | Contact Us