DEV Community

loading...

Discussion on: Why you can't break a forEach loop | ByteSize JS

Collapse
codenutt profile image
Jared Author

Interesting! Thank you for your insight. I haven't used every much. Very handy!

Collapse
folke profile image
Folke Lemaitre

.some() is probably even better in most cases. Just return true whenever you need to break. No need to return anything when you want to keep going :)

Thread Thread
codenutt profile image
Jared Author

Sweet! May have to do a deep dive article into all the various loop types.