for

for is a loop that executes when the condition is true.

It is similar to a while loop but has different syntax.

Syntax

for(variable; condition; increment)
{
    code
}

Examples

Internal

do while

for in

for of

while

External

Mozilla Developer Network

Home Menu