tencent cloud

Tencent Cloud Observability Platform

URLSearchParams.getAll

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2025-03-11 20:21:25
URLSearchParams.getAll is used to get all values for the specified search parameter.
getAll(key: string): string[]

Parameters

Parameter
Type
Description
key
string
Key.

Return

Type
Description
string[]
All values for the specified search parameter.

Samples

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

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

params.append('key1', 1);
console.log(params.getAll('key1')); // value1,1
}


Ajuda e Suporte

Esta página foi útil?

comentários