Often when you write code, you want the same block of code to run over and over again in a row. 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


This entry was posted on 3:26 AM and is filed under , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 comments: