URLSearchParams
URLSearchParams is a Web API interface that provides convenient access to the query component of a URL. It represents the query string as an ordered list of key-value pairs and supports reading, adding, removing, and updating parameters without manual string manipulation. It is part of the WHATWG URL API and is implemented in all major browsers and in Node.js.
Construction and mutability: URLSearchParams can be created from a query string, from an existing URLSearchParams, or
Core methods and properties: The interface includes append(name, value) to add a parameter, delete(name) to remove
Iteration and serialization: toString() returns a percent-encoded query string representing the current parameters, using UTF-8 encoding
Compatibility and usage: URLSearchParams is widely supported in modern browsers and available in Node.js. It is