The `delete()` method is used to remove the given key, and all its associated values from the target query. This means if the key is repeated in the query like two or more times, when we call the `delete()` method on that key, all the entries that have the key will be removed.
URLSearchParams delete() Method Syntax:
URLSearchParams delete() Method Parameter:
The method takes one argument and that is the name of the key which we want it to be removed from the query.
URLSearchParams delete() Method Return Value:
The method does not return a value.
const searchParams = new URLSearchParams("?name=John&lastName=Doe&address=Mars&name=Omid"); searchParams.delete("name"); console.log(searchParams);