Common JavaScript Manual/While and For loops

While
While expression looks so: Here, if the condition is true then the code inside the loop and then the process goes first but if the condition is true then execution continues after the loop. Let's see example.

For
"For" cycle is a short form of while.

Let's rewrite our code.