If JS had pattern matching catch guards what would this print? try { try { throw "foo"; } catch (anything) { console.log("anything"); } } catch (str match String) { console.log("string"); }
Replying to @sebmarkbage
I would assume `anything`. But if it matched `str` you could wrap computations with higher order functions containing different catches. Most specific catch wins instead of closest catch wins. I agree that it's more useful. Not sure if there are problems.
2:26 AM - 21 Mar 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.