diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/javascript/reference/global_objects/uneval/index.html | |
parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
download | translated-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/uneval/index.html')
-rw-r--r-- | files/pt-br/web/javascript/reference/global_objects/uneval/index.html | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/uneval/index.html b/files/pt-br/web/javascript/reference/global_objects/uneval/index.html new file mode 100644 index 0000000000..f137fffd53 --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/uneval/index.html @@ -0,0 +1,106 @@ +--- +title: uneval() +slug: Web/JavaScript/Reference/Global_Objects/uneval +translation_of: Web/JavaScript/Reference/Global_Objects/uneval +--- +<div>{{jsSidebar("Objects")}}{{Non-standard_header}}</div> + +<p>O método <code><strong>uneval()</strong></code> cria uma representação do código fonte de um Objeto.</p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox">uneval(<var>object</var>)</pre> + +<h3 id="Parâmetros">Parâmetros</h3> + +<dl> + <dt><code>object</code></dt> + <dd>A JavaScript expression or statement.</dd> +</dl> + +<div class="note"><strong>Nota:</strong> Você não obterá uma representação em JSON válida para o Objeto..</div> + +<h2 id="Descrição">Descrição</h2> + +<p><code>uneval()</code> é uma função top-level e não é associada a nenhum objeto.</p> + +<h2 id="Examples">Examples</h2> + +<pre class="brush:js">var a = 1; +uneval(a); // retorna uma String contendo 1 + +var b = "1"; +uneval(b) // retorna uma String contendo "1" + +uneval(function foo(){}); // retorna"(function foo(){})" + + +var a = uneval(function foo(){return 'hi'}); +var foo = eval(a); +foo(); // retorna "hi" +</pre> + +<h2 id="Especificações">Especificações</h2> + +<p>Not part of any specifications.</p> + +<h2 id="Compatibilidade_dos_Navegadores">Compatibilidade dos Navegadores</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{jsxref("Global_Objects/eval", "eval()")}}</li> + <li>{{jsxref("JSON.stringify")}}</li> + <li>{{jsxref("JSON.parse")}}</li> + <li>{{jsxref("Object.toSource")}}</li> +</ul> |