for loop in node js

JavaScript
var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) { 
  console.log(colors[i]);
}var i; //defines i
for (i = 0; i < 5; i++) { //starts loop
  console.log("The Number Is: " + i); //What ever you want
}; //ends loop
//Or:
console.log("The Number Is: " + 0);
console.log("The Number Is: " + 1);
console.log("The Number Is: " + 2);
console.log("The Number Is: " + 3);
console.log("The Number Is: " + 4);
//They do the same thing!
//Hope I helped!let array = ['Item 1', 'Item 2', 'Item 3'];

array.forEach(item => {
	console.log(item); // Logs each 'Item #'
});let array = ['Item 1', 'Item 2', 'Item 3'];

for (let index = 0; index < array.length; index++) {
  console.log("index", index);
  console.log("array item", array[index]);
}let array = [1,2,3,4,5,6,7,8,9,10]; 
// our array that we will use the for loop on
for (let i = 0; i < array.length; i++) { 
  // this loop will console log the element at array[i] starting at 0
  // and will continue looping for i < array.length 
  console.log(array[i]);
  // after each loop i will increase by 1
}

// this will console log
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
var i;
for (i = 0; i < cars.length; i++) {
  text += cars[i] + "<br>";
}
Source

Also in JavaScript: