Answers for "array list loop javascript"

13

loop through list js

var arr = ["f", "o", "o", "b", "a", "r"]; 
for(var i in arr){
	console.log(arr[i]);
}
Posted by: Guest on November-12-2021
8

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
6

iterate through list javascript

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

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language