Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript while loop

var i = 1;                      // initialize
while (i < 100) {               // enters the cycle if statement is true
i *= 2;                     // increment to avoid infinite loop
document.write(i + ", ");   // output
}
Source by htmlcheatsheet.com #
 
PREVIOUS NEXT
Tagged: #javascript #loop
ADD COMMENT
Topic
Name
7+4 =