Stopping a forEach loop

Currently there is no way to abort the iteration of a forEach loop.

In jquery, if the callback function returns false the loop will stop. (.each() | jQuery API Documentation and search for: “You can stop the loop from within the callback function by returning false.”)

What do you guys think?

If you’re trying to break on the first condition that is true, there is always Ember.Enumerable.html#method_find

1 Like