aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/javascript/reference/global_objects/map/values/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/map/values/index.html')
-rw-r--r--files/pt-br/web/javascript/reference/global_objects/map/values/index.html74
1 files changed, 74 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/map/values/index.html b/files/pt-br/web/javascript/reference/global_objects/map/values/index.html
new file mode 100644
index 0000000000..8bb1e96bca
--- /dev/null
+++ b/files/pt-br/web/javascript/reference/global_objects/map/values/index.html
@@ -0,0 +1,74 @@
+---
+title: Map.prototype.values()
+slug: Web/JavaScript/Reference/Global_Objects/Map/values
+tags:
+ - Iterador
+ - Mapa
+ - metodo
+translation_of: Web/JavaScript/Reference/Global_Objects/Map/values
+---
+<div>{{JSRef}}</div>
+
+<p>O método <code><strong>values()</strong></code> retorna um novo objeto <strong><a href="/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators">Iterator</a></strong> que contém os valores de cada elemento do objeto <code>Map</code> em ordem de inserção.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/map-prototype-values.html")}}</div>
+
+
+
+<h2 id="Sintaxe">Sintaxe</h2>
+
+<pre class="syntaxbox"><code><em>meuMap</em>.values()</code></pre>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>Um novo objeto iterador do {{jsxref("Map")}}.</p>
+
+<h2 id="Exemplos">Exemplos</h2>
+
+<h3 id="Usando_o_values()">Usando o <code>values()</code></h3>
+
+<pre class="brush:js">var meuMap = new Map();
+meuMap.set('0', 'foo');
+meuMap.set(1, 'bar');
+meuMap.set({}, 'baz');
+
+var mapIter = myMap.values();
+
+console.log(mapIter.next().value); // "foo"
+console.log(mapIter.next().value); // "bar"
+console.log(mapIter.next().value); // "baz"</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-map.prototype.values', 'Map.prototype.values')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-map.prototype.values', 'Map.prototype.values')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_de_navegadores">Compatibilidade de navegadores</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Map.values")}}</p>
+
+<h2 id="Veja_também">Veja também</h2>
+
+<ul>
+ <li>{{jsxref("Map.prototype.entries()")}}</li>
+ <li>{{jsxref("Map.prototype.keys()")}}</li>
+</ul>