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.
You can implement an infinite loop using the while statement as follows: while (true){ // your code goes here }. The Java programming language also provides a do-while statement, which can be expressed as follows: do { statement(s) } while (expression); The difference between do-while and while is that do-while evaluates its expression at the bottom of the loop instead of the top.