3 ms·
Clearly he can handle it given that he mentioned try-catch and the cons of using that approach (cant use const, the control flow is exception-driven, increased
by koito17 2y ago
Clearly he can handle it given that he mentioned try-catch and the cons of using that approach (cant use const, the control flow is exception-driven, increased verbosity, etc.)
The key takeaway of the article is that the author kickstarted interest in extending the URL API so that people can actually validate URLs. Not many people are fond of the idea of "validation by running a function and seeing if it throws an exception".
- happytoexplain 2y ago> Not many people are fond of the idea of "validation by running a function and seeing if it throws an exception". That's only because JS makes it unnecessarily verbose in the case where they don't care about the error message. It's exactly what they should want to do, rather than add another piece of the API to have to remember.