You've been wrapping `new URL()` in try/catch. `URL.parse()` does it natively.

TL;DR AI
2 min readKey summary
Modern browsers now support `URL.canParse()` and `URL.parse()`, reducing the need to wrap `new URL()` in `try/catch`.
`URL.canParse()` returns a boolean for validity checks, while `URL.parse()` behaves like a constructor but returns `null` instead of throwing.
Both APIs support an optional base URL, making it easier to handle relative paths, user input, and API responses.
They cut repetitive helper code, avoid exceptions in normal validation flows, and make URL handling more consistent and readable.
