Sets or replaces a query parameter in a URL string and returns the new URL.
The base URL string.
The query parameter name.
The value to set.
setQueryParam("https://example.com?q=old", "q", "new")// => "https://example.com/?q=new" Copy
setQueryParam("https://example.com?q=old", "q", "new")// => "https://example.com/?q=new"
Sets or replaces a query parameter in a URL string and returns the new URL.