Answers for "forEach loops 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
0

ForEach loop

const a = ["a", "b", "c"];
a.forEach((entry) => {
    console.log(entry);
});
Posted by: Guest on July-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language