--- title: URLSearchParams.values() slug: Web/API/URLSearchParams/values translation_of: Web/API/URLSearchParams/values ---
{{APIRef("URL API")}}
O método URLSearchParams.values()
retorna um {{jsxref("Iteration_protocols",'iterator')}} que permite passar por todos os valores do objeto. Os valores são objetos {{domxref("USVString")}}.
Nota: Esse método está disponível no Web Workers.
searchParams.values();
Retorna um {{jsxref("Iteration_protocols","iterator")}}.
// Cria um objeto URLSearchParams var searchParams = new URLSearchParams("key1=value1&key2=value2"); // Mostra os pares de chave/valor for(var value of searchParams.values()) { console.log(value); }
O resultado é:
value1 value2
Specification | Status | Comment |
---|---|---|
{{SpecName('URL', '#urlsearchparams','values() (as iterator<>)')}} | {{Spec2('URL')}} | Definição inicial. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatGeckoDesktop(44)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatGeckoMobile(44)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatNo}} |