Working with URLs in JavaScript - LogRocket Blog
Briefly

The URL API allows developers to easily parse and manipulate URLs in modern web applications, providing access to various parts of a URL efficiently.
Using the URL API instead of older methods simplifies URL parsing, eliminates the need for a DOM environment, and provides built-in error handling.
You can access a URL's query string via the search property for the full string, or the searchParams property for a more manageable URLSearchParams object.
Older methods, such as using an <a> element or regular expressions, can be tedious and error-prone, emphasizing the importance of using modern URL parsing techniques.
Read at LogRocket Blog
[
|
]