The forEach() method executes a provided function once for each array element.
forEach()
const array1 = ['a', 'b', 'c']; array1.forEach(element => console.log(element)); // expected output: "a" // expected output: "b" // expected output: "c"
Last updated 4 years ago