Breaking out of a forEach loop in JavaScript
Sep 22, 2021 · 1 min read · In JavaScript we can use the break keyword to immediately stop iterating through a for loop. There is no equivalent for the forEach() loop, which is much more commonly used today. An alternative that will achieve the same behavior is using the every(...
Join discussion