tencent cloud

URLSearchParams.get
마지막 업데이트 시간:2025-03-11 20:21:25
URLSearchParams.get
마지막 업데이트 시간: 2025-03-11 20:21:25
URLSearchParams.get is used to get the first value for the specified search parameter.
get(key: string): null | string

Parameters

Parameter
Type
Description
key
string
Key.

Return

Type
Description
null or string
The first value for the specified key, or null if not found.

Samples

Get the first value for the specified search parameter:
import url from 'pts/url';

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

const value1 = params.get('key1');
console.log(value1); // value1
const value3 = params.get('key3');
console.log(value3); // null
}

문제 해결에 도움이 되었나요?
더 자세한 내용은 문의하기 또는 티켓 제출 을 통해 문의할 수 있습니다.
아니오

피드백