DEV Community

Discussion on: Why can't you break out of the forEach loop?

Collapse
 
kuya1284 profile image
kuya1284

I think defining your own custom forEach loop is redundant. You can use what's already available, like using Array.some().

If you need to simulate "continue" in a forEach loop, use "return".