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.
A while loop will always evaluate the condition first. A do/while loop will always execute the code in the do{} block first and then evaluate the condition. A for loop allows you to initiate a counter variable, a check condition, and a way to increment your counter all in one line.