This page demistrates JavaScript loops and how they can be used.
What can be used in a Loop:
|
Greater than (>) |
Less than (<) |
Equal to (==) |
Greater than or Equal to (>=) |
Less than or Equal to (<=) |
NOT Equal to (!=) |
Don't forget curly braces ({}) when you have more than one statement in your Loop! |
|
Code |
Output |
|
|
|
|
|
THE LOOP DOSE NOTHING BECAUSE CONDITIONS ARE ALREADY MET!!
|
|
THE LOOOP STOPS AT 4 BECAUSE OF THE BREAK!
*HTML code was cut off due to size
|
|
NOTICE THAT NUMBER 5 IS MISSING!!
*HTML ccode was cut off due to size
|
|
*HTML ccode was cut off due to size
|