For Loop

for (expression 1; expression 2; expression 3) {
  // code block to be executed
}

Expression 1 is executed (one time) before the execution of the code block.

Expression 2 defines the condition for executing the code block.

Expression 3 is executed (every time) after the code block has been executed.

for (let i = 0; i < 5; i++) {
    console.log(i);
}

1. for Loop:

for (let i = 0; i < 5; i++) {
    console.log(i);
}

2. while Loop:

let i = 0;
while (i < 5) {
    console.log(i);
    i++;
}

3. do-while Loop:

let i = 0;
do {
    console.log(i);
    i++;
} while (i < 5);

4. for...in Loop:

let person = {
    name: "Vignesh",
    age: 19,
    job: "Developer"
};
for (let key in person) {
    console.log(key, person[key]);
}

5. for...of Loop: