Returns the value of a query parameter from a URL string. Returns null if the parameter is absent or the URL is invalid.
null
The URL string.
The query parameter name.
getQueryParam("https://example.com?q=hello", "q") // => "hello"getQueryParam("https://example.com", "q") // => null Copy
getQueryParam("https://example.com?q=hello", "q") // => "hello"getQueryParam("https://example.com", "q") // => null
Returns the value of a query parameter from a URL string. Returns
nullif the parameter is absent or the URL is invalid.