DEV Community

loading...

Discussion on: Making Await More Functional in JavaScript

Collapse
craigmichaelmartin profile image
craig martin Author

Hm, interesting. I didn't mean for it to be dishonest. I've always held return-ing inside a catch to be taboo and so didn't even consider it here. Things can get crazy (for example) if a finally clause is then attached. I can't even tell you the what the result would be between js evaluating the finally and returning the value from the catch, which is probably why I've never let myself return in a catch... but maybe I should update the example? Or maybe this adds more to the "casually dangerous" / less readable point?

Anyway, thanks for calling it out!!