We can use the
forEach
method to pass through the elements of an array. Which of the following code snippets will display all consecutive elements of the animals array in the console?
-
animals.forEach(a => { console.log(a); })
-
forEach(animals, a => { console.log(a); })
animals.forEach(console.log(animal));
animals.forEach(a => a);
More Questions: JavaScript Essentials 1 – JSE1: Module 5 Test
Please login or Register to submit your answer