The URLSearchParamsspec defines an interface and convenience methods for working with the query string of a URL (e.g. everything after "?"). This means no more regex'ing and string splitting URLs!
A URLSearchParams object can be used directly in a for...of block.
Basic example
Live Output
The URL constructor integrates with URLSearchParams by adding a read-only property, .searchParams:
Live Demo
Below, you can manipulate the URL of this page by changing the parameter name
to get/set values. The URL will update using the URLSearchParams and window.history API.