for javascript

JavaScript
let str = "";

for (let i = 0; i < 9; i++) {
  str = str + i;
}

console.log(str);
// expected output: "012345678"
  var i;
for (i = 0; i < cars.length; i++) { 
  text += cars[i] + "<br>";

 } for (i = 0; i < 5; i++) {
   text += "The number is " + i + "<br>";
}  var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) { 
  console.log(colors[i]);
}var texts = [
    'a1',
    'a2',
    'a3',
];

for (var i = 0; i < 3; i++) {
    console.log(ceps[i]);
}
/* Result
a1
a2
a3
*/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]);
}
Source

Also in JavaScript: