The for Loop

Shaik Zeeshan

For Loop

The for loop is a control flow statement that allows you to execute a block of code multiple times. It is often used when you know how many times you want to execute a block of code.

The for loop has the following syntax:

javascript

for (initialization; condition; increment) {
  // code block to be executed
}

typescript

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

golang

for i := 0; i < 5; i++ {
  fmt.Println(i)
}