The For loop in JavaScript:

The for loop is most commonly use loop in JavaScript. In for loop there are three important parts which you should not ignore. They are as follows:

  • Initialization : in this part you initialize your variable
  • condition : in this part you test the condition of your code is it true or false
  • iteration : in this part you can increase or decrease your variable

Syntax:

Example:

In following example we are printing number starting form 10 to 1

 

One response to “For loop in JavaScript”

  1. Carrol Whisenton says:

    This is the appropriate blog for anyone who desires to seek out out about this topic. You understand so much its almost hard to argue with you (not that I really would need…HaHa). You undoubtedly put a brand new spin on a topic thats been written about for years. Nice stuff, just great!

Leave a Reply

Your email address will not be published. Required fields are marked *