tencent cloud

URLSearchParams.delete
Last updated: 2025-03-10 17:23:44
URLSearchParams.delete
Last updated: 2025-03-10 17:23:44
URLSearchParams.delete is used to delete the specified key and its corresponding value from the search parameter list.
delete(key: string): void

Parameters

Parameter
Type
Description
key
string
Key.

Return

Type
Description
void
No data returned.

Samples

Delete the specified key and its corresponding value from the search parameter list:
import url from 'pts/url';

export default function() {
const params = new url.URLSearchParams('key1=value1&key2=value2');

params.delete('key2');
console.log(params.toString()); // key1=value1
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback