CoderZone.org

Category: >> JavaScript >> Example FOR, WHILE, and DO Loops Bookmark and Share

<< lastnext >>

Snippet Name: Example FOR, WHILE, and DO Loops

Description: Examples of the three different ways you can do loops in JavaScript.

Also see:
» Add a hidden field to a form dynam...
» Add more fields to a form dynamica...
» Validate file extensions in upload...
» Get Unix Timestamp for midnight to...
» Get Easter Date for any year in Ja...
» Date Picker Form in ASP
» Check for a Valid Email Address (V...
» Removing duplicate array items whi...
» Check For A Valid Email Address
» Getting Values Submitted From A Fo...
» Test for Prime Numbers
» Format money as millions, billions...
» Truncate text while preserving HTM...
» Convert UK Dates To mySQL Format D...
» Search array elements for a substr...
» Calculate the difference between t...
» Check for duplicates and delete du...
» RMAN: Format Directives
» USER - connection information
» USER - User Information 2
» USER Information
» SQL*Plus formatting
» Create string by formatting an amo...
» Search PL/SQL for a string/ key va...
» Perl While Loop Example
» SELECT: Select For Update
» List security related profile info...
» List all indexed columns for a giv...
» FORALL Insert

Comment: (none)

Author: CoderZone
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: December 01st, 2010

// Example FOR while loop:
 
for (i = 0; i <= 10; i++){
	document.write (i + "
");
}
 
 
// Example WHILE loop:
 
var i = 0;
while (i <= 10){
	document.write (i + "
");
	i++;
}
 
 
// Example DO loop:
 
var i = 0;
do {
	document.write(i + "
");
	i++;
}
while (i <= 10)
 
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 10