javascript how to use the string from array in foreach code example
Example 1: JavaScript Array Methods .forEach()
let days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
days.forEach(function log(day) {
console.log(day)
})
days.forEach(day => {
console.log(day)
});
days.forEach(day => console.log(day));
Example 2: how to use the foreach fnction javascript loop through array
const names = ['Anthony','Stacey','Mason','Gracie','Koda','Nani'];
forEach(function(name) {
console.log(name);
});