aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/orphaned
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-05-29 01:14:43 +0000
committerMDN <actions@users.noreply.github.com>2021-05-29 01:14:43 +0000
commitd94b4f47476bbc901753f68d6dfe317e1c5c732e (patch)
tree590036437f5c828d71f35d6880228be2b4361b50 /files/pt-br/orphaned
parent05a7219ba9605649cb6daa281e26209eaa73adf0 (diff)
downloadtranslated-content-d94b4f47476bbc901753f68d6dfe317e1c5c732e.tar.gz
translated-content-d94b4f47476bbc901753f68d6dfe317e1c5c732e.tar.bz2
translated-content-d94b4f47476bbc901753f68d6dfe317e1c5c732e.zip
[CRON] sync translated content
Diffstat (limited to 'files/pt-br/orphaned')
-rw-r--r--files/pt-br/orphaned/web/javascript/reference/operators/pipeline_operator/index.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/files/pt-br/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/pt-br/orphaned/web/javascript/reference/operators/pipeline_operator/index.html
new file mode 100644
index 0000000000..84ea16c7bc
--- /dev/null
+++ b/files/pt-br/orphaned/web/javascript/reference/operators/pipeline_operator/index.html
@@ -0,0 +1,66 @@
+---
+title: Operador Pipeline
+slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator
+translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator
+original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator
+---
+<div>{{jsSidebar("Operators")}} {{SeeCompatTable}}</div>
+
+<p>O operador experimental pipeline <code>|&gt;</code> (atualmente no estágio 1) permite a criação de chamadas de funções encadeadas de maneira legível. Basicamente, o operador de pipeline fornece açúcar sintático em uma chamada de função com um único argumento, permitindo que você escreva</p>
+
+<p><code>'%21' |&gt; decodeURI</code> ao invés de <code>decodeURI('%21')</code>.</p>
+
+<h2 id="Sintaxe">Sintaxe</h2>
+
+<pre class="syntaxbox">expressão |&gt; função</pre>
+
+<h2 id="Exemplos">Exemplos</h2>
+
+<h3 id="Chamadas_de_funções_encadeadas">Chamadas de funções encadeadas</h3>
+
+<p> </p>
+
+<p>O operador de pipeline pode melhorar a legibilidade ao encadear várias funções.</p>
+
+<pre class="brush: js">const double = (n) =&gt; n * 2;
+const increment = (n) =&gt; n + 1;
+
+// sem o perador pipeline
+double(increment(double(double(5)))); // 42
+
+// com o operador pipeline
+5 |&gt; double |&gt; double |&gt; increment |&gt; double; // 42
+</pre>
+
+<h2 id="Especificações">Especificações</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a href="https://tc39.github.io/proposal-pipeline-operator/#sec-intro">Pipeline operator draft</a></td>
+ <td>Estágio 1</td>
+ <td>Não faz parte da especificação ECMAScript ainda.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidade_com_os_navegadores">Compatibilidade com os navegadores</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.operators.pipeline")}}</p>
+</div>
+
+<h2 id="Ver_também">Ver também</h2>
+
+<ul>
+ <li><a href="https://github.com/tc39/proposals">TC39 proposals</a></li>
+</ul>