Answers for "foreach javascript'"

131

javascript foreach

const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
	console.log(index, item)
})
Posted by: Guest on April-27-2020
8

javascript foreach

let numbers = ['one', 'two', 'three', 'four'];

numbers.forEach((num) => {
  console.log(num);
});  // one   //two //three // four
Posted by: Guest on July-16-2020
1

foreach in javascript

const avengers = ['IronMan','thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
	console.log(index, item)
})
Posted by: Guest on April-27-2021
0

foreach loop javascript

listName.forEach((listItem) => {
  Logger.log(listItem);
}):
Posted by: Guest on November-17-2020
-2

javascript foreach syntax

const marks = [12, 17, 14];
let sum = 0;

marks.forEach(mark => {
  sum += mark;
});
Posted by: Guest on October-31-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language