JavaScript forEach 2 – How to Loop Through an Array in JS

PHOTO EMBED

Fri Nov 13 2020 21:51:09 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #javascript

numbers.forEach((number, index, array) => {
    console.log(array);
});

numbers.forEach((number, index) => {
    console.log('Index: ' + index + ' Value: ' + number);
});
content_copyCOPY

https://www.freecodecamp.org/news/javascript-foreach-how-to-loop-through-an-array-in-js/