the .forEach() method

PHOTO EMBED

Mon Jul 18 2022 20:10:35 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

const fruits = ['mango', 'papaya', 'pineapple', 'apple'];

// Iterate over fruits below : output "I want to eat each fruit"
fruits.forEach(fruitItem => console.log(`I want to eat a ${fruitItem}`));
content_copyCOPY