Nuacht

In previous lessons, we've learned about JavaScript's built-in Array methods and how they help us save work and write more efficient, readable code. In this lesson, we'll talk about one more: forEach( ...
Well, the forEach () method doesn’t actually return anything (undefined). It simply calls a provided function on each element in your array. This callback is allowed to mutate the calling array.
Hence here we will learn how we can iterate through the elements of an array as per ES6. It avoids the pitfalls that we met in “for-in”. Unlike forEach () , “for-of” will work with break, return and ...