Home of web learners


loop is used to execute a script within a condition

Lets start with an example:

    var i;



Here,we use for loop to do the same work again and again,so in i=1 we initialize counting variable

After semicolon we check the condition to limit the loop to how much number of time we want to execute our for loop body,which start from { and end with }

Then after semicolon this part is for increment or decrement counter variable,here we increment by 1

And in the body part,we execute the data in i to see is for loop working,we see that it shows that i is increasing,end with the condition


About webn3rd