Answers for "loop a list in javascript"

14

javascript loop through array

var colors = ["red","blue","green"];
colors.forEach(function(color) {
  console.log(color);
});
Posted by: Guest on March-06-2020
7

iterate through list js

const array = ["one", "two", "three"]
array.forEach(function (item, index) {
  console.log(item, index);
});
Posted by: Guest on May-31-2020
5

iterate through list javascript

const array = ["hello", "world"];

for (item of array) {
	//DO THIS
}
Posted by: Guest on May-24-2020
2

javascript for loop[

for(i=0;i<=5;i++){
  console.log(i);}
Posted by: Guest on June-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language