Created
February 7, 2017 15:16
-
-
Save dginev/bf96fad96d68faca242d25f035fdde18 to your computer and use it in GitHub Desktop.
You can't use break inside of .forEach?!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
someArray.forEach((content, index) => { | |
// do stuff with content | |
if (breaking_condition) { | |
throw "Table"; // breaks forEach (╯°□°)╯︵ ┻━┻) | |
} | |
}) | |
} catch (e) { | |
// short-circuited forEach ┬──┬◡ノ(°-°ノ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment