Real Basics of Loops :: How the 'for loop' works in JavaScript

Real Basics of Loops :: How the 'for loop' works in JavaScript

for (initialization; condition; afterthought)
  statement
  1. initialization is first executed.

  2. and then it goes to condition part and if is true

  3. now it goes into statement part

  4. After executing all the statements

    it goes to afterthought

  5. And then go back to condition part until it returns false.

I thougt I knew well this concept of iterating but when i encountered more diffucult and complex for loop I needed to learn again this basic things. So I write it easily to do some revision.