For loop executes statements for given number of times, until condition become false. It is an Entry control loop.

Syntax

for(initialization; condition; iteration)
{
   // Set of statements
}

for loop has three parts:

initializationInitial or starting value from where loop starts
conditionnumber of times loop executes
iterationIncrement or decrement to continue loop cycle or iteration

Example

<script>
let i;
for(i = 0; i < 10; i++)
{
   document.write(i);
}
</script>

Above example prints numbers from 0 to 9.