Answers for "how to pass an array to a foreach javascript"

131

javascript array foreach example

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

Code answers related to "how to pass an array to a foreach javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language