Tech Insights· gomakethings.com
JavaScript’s forEach loops don’t have continue, you can achieve the same result by using return
From gomakethings.com
On Monday, we looked at how to use a for loop to iterate through arrays and NodeLists. Today, we’re going to look at how ES6 forEach() methods make it even easier. TheArray.forEach() ES6 introduced the Array.forEach() method for looping through arrays. You call this method on your array, and pass in a callback function to run on each iteration of the loop. The callback accepts two arguments. The first is the value of the current item in the loop, and the second is the index of that item.
Shared by



