layout: post title: Iterate with javascript for loops date: 2017-08-21 —-
Iterate with javascript for loops
1- The initialization statement:
-
is executed one time only before the loop starts.
-
It is typucal used to define and setup your loop variable.
2- Condition statement:
-
Is evaluated at the beginning of every loop iteration and will continue as long i t evaluates to true.
-
When condition false at the start of the iteration,the loop will stop executing.
-
This means if condition starts as false,your loop will never execute.
3-The final-expression:
-
Is executed at the end of each loop iteration,
-
prior to the next conditon check and
-
is ussualy used to increment or decrement your loop counter.