tencent cloud

URLSearchParams.append
Last updated: 2025-03-11 20:21:24
URLSearchParams.append
Last updated: 2025-03-11 20:21:24
URLSearchParams.append is used to add the specific key-value pair as a search parameter.
append(key: string, value: string | number): void

Parameters

Parameter
Type
Description
key
string
Key
value
string or number
Value

Return

Type
Description
void
No data returned.

Samples

Add the specified key-value pair as a search parameter:
import url from 'pts/url';

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

params.append('key2', 'value2');
console.log(params.toString()); // key1=value1&key2=value2
}

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

Feedback