JavaScript – Nuances of myArray.forEach vs for loop
The most substantive difference between the for loop and the forEach method is that, with the former, you may break out of the loop. You can simulate continue by simply returning from the function passed to forEach, but there is no way to stop looping altogether. Aside from that, the two accomplish effectively the same … Read more