tencent cloud

URLSearchParams.keys
Last updated: 2025-03-11 20:21:25
URLSearchParams.keys
Last updated: 2025-03-11 20:21:25
URLSearchParams.keys is used to get all key names in the search parameter.
keys(): string[]

Return

Type
Description
string[]
All key names in the search parameter.

Samples

Get all key names for the specified search parameter:
import url from 'pts/url';

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

console.log(params.keys()); // key1,key2
}

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

Feedback