for loop using javascript

JavaScript
for loop in javascriptvar colors=["red","blue","green"];
for(let color of colors){
  console.log(color)
}const array1 = ['a', 'b', 'c'];

for (const element of array1) {
  console.log(element);
}

// expected output: "a"
// expected output: "b"
// expected output: "c"
for (i = 0; i < 5; i++) {

   text += "The number is " + i + "<br>";

}

  
for (statement 1; statement 2; statement 3) {

      // code block to be executed

 }

 
Source

Also in JavaScript: