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.
public class TestDoWhile { public static void Main { int x = 0; do { Console.WriteLine(x); x++; } while (x < 5); } } /* Output: 0 1 2 3 4 */ Unlike the while statement, a do-while loop is executed one time before the conditional expression is evaluated.