Answers for "how does a for loop work in javascript"

220

javascript for loop

var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) { 
  console.log(colors[i]);
}
Posted by: Guest on June-17-2019
17

javascript for loop

for (var i; i < 10; i++) {
  
}
Posted by: Guest on May-26-2020
12

javascript loop

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]);
}
Posted by: Guest on March-04-2020
0

javascript for loop

let my_capacity = 15;
for (let my_var = 0; my_var < my_capacity; my_var++)
{
  console.log(my_var)
}
Posted by: Guest on December-30-2020

Code answers related to "how does a for loop work in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language