Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: Symbol.breakLoop for exit from forEach loops #41
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
ghost
May 30, 2015
What's wrong with using .some / .every and using return true / return false to break out?
ghost
commented
May 30, 2015
|
What's wrong with using |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
xlaywan
commented
May 30, 2015
|
Oh, sure, forgot them) Issue can be closed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
ljharb
May 30, 2015
Member
Also ES6's Array#find will return the item you're looking for, or undefined, stopping the iteration as soon as the predicate returns true.
|
Also ES6's |
bterlson
closed this
Sep 22, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xlaywan commentedMay 30, 2015
Now there is no way to exit from forEach loops.
Traditional equivalent
Or just
Symbol.break.