Find great deals on eBay for Woodstock Ticket in Music Memorabilia. Shop with confidence.
Instead of adding several almost equal lines in a script we can use loops to perform a task like this. In JavaScript there are two different kind of loops: for - loops through a block of code a specified number of times. while - loops through a block of code while a specified condition is true.
Remember that the WHILE loop tests at the start of the loop and does not test again until the loop has completely run and returned to the loop start. Both the endless loop and the WHILE loop execute until a condition is met.se a WHILE loop when the condition test is required at the start of the loop. The next example contains three WHILE loops. The last loop will never execute because the condition will never be true. The middle loop uses multiple condition tests, using the AND key word.