Proposal: Conditional `catch` in Promises

Ayush Gupta ayushg3112 at
Wed Apr 25 04:11:15 UTC 2018

We could potentially provide the same functionality in `try/catch` by
extending the signature of `catch` to

try {

} catch(<expression_var>, <function_expression>) {


If `<function_expression>` evaluates to truthy, invoke the `catch` block,
otherwise don't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list