Answers for "can we use for and forEach in js"

35

foreach javascript

let words = ['one', 'two', 'three', 'four'];
words.forEach((word) => {
  console.log(word);
});
// one
// two
// three
// four
Posted by: Guest on May-27-2020
0

foreach javascript

let dogs = ['Husky','Black Lab','Australian Shepard','Golden Retriever'];

dogs.forEach(function(dog) {
	console.log(dog); 
});
Posted by: Guest on April-19-2021

Code answers related to "can we use for and forEach in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language