5.5.6 for repetation statement

The Javascript For loop resembles the for loop you might have seen in many other programming languages.  It is used when you need to do a set of operations many times, with an increment of some kind after each run through the block of code.


For (var = startvalue; var<=end value; var=var+increment)
         Code to be executed


<script type = “text/javascript”>
Var linebreak = “<br/>”;
Document.write(“For loop code is beginning”);

For (I = 0; i< 5, i++){
               document.write (“Counter i=”+i);
Document.write (“For loop code is finished!”);


The above for loop starts with i=0 and get executed until the condition i<5; I will increase by 1 each time the loop runs.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

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

six + = 14

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter