aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html')
-rw-r--r--files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html74
1 files changed, 74 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html b/files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html
new file mode 100644
index 0000000000..fd35e8ce40
--- /dev/null
+++ b/files/pt-br/web/javascript/reference/global_objects/weakmap/get/index.html
@@ -0,0 +1,74 @@
+---
+title: WeakMap.prototype.get()
+slug: Web/JavaScript/Reference/Global_Objects/WeakMap/get
+translation_of: Web/JavaScript/Reference/Global_Objects/WeakMap/get
+---
+<div>{{JSRef}}</div>
+
+<p>O método <code><strong>get()</strong></code> retorna um elemento especificado de um objeto <code>WeakMap</code>.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/weakmap-prototype-get.html")}}</div>
+
+<p class="hidden">A fonte para este exemplo interativo está em um repositório no GitHub. Caso você queira contribuir para o projeto de exemplos interativos, por favor clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> e nos envie uma pull request.</p>
+
+<h2 id="Sintaxe">Sintaxe</h2>
+
+<pre class="syntaxbox"><code><em>wm</em>.get(chave);</code></pre>
+
+<h3 id="Parâmetros">Parâmetros</h3>
+
+<dl>
+ <dt>chave</dt>
+ <dd>Obrigatório. A chave do elemento a ser retornado pelo objeto <code>WeakMap</code>.</dd>
+</dl>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>O elemento associado à chave especificada no objeto <code>WeakMap</code>. Se a chave não for encontrada, retorna-se {{jsxref("undefined")}}.</p>
+
+<h2 id="Exemplos">Exemplos</h2>
+
+<h3 id="Utilizando_o_método_get">Utilizando o método <code>get</code> </h3>
+
+<pre class="brush: js">var wm = new WeakMap();
+wm.set(window, 'foo');
+
+wm.get(window); // Retorna "foo".
+wm.get('baz'); // Returna undefined.
+</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-weakmap.prototype.get', 'WeakMap.prototype.get')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-weakmap.prototype.get', 'WeakMap.prototype.get')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_dos_navegadores">Compatibilidade dos navegadores</h2>
+
+
+
+<p>{{Compat("javascript.builtins.WeakMap.get")}}</p>
+
+<h2 id="Ver_também">Ver também</h2>
+
+<ul>
+ <li>{{jsxref("WeakMap")}}</li>
+ <li>{{jsxref("WeakMap.set()")}}</li>
+ <li>{{jsxref("WeakMap.has()")}}</li>
+</ul>