From d94b4f47476bbc901753f68d6dfe317e1c5c732e Mon Sep 17 00:00:00 2001 From: MDN Date: Sat, 29 May 2021 01:14:43 +0000 Subject: [CRON] sync translated content --- files/de/_redirects.txt | 1 + files/de/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 68 +++++++++++++++++ .../operators/pipeline_operator/index.html | 67 ---------------- files/es/_redirects.txt | 3 +- files/es/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 79 +++++++++++++++++++ .../operators/pipeline_operator/index.html | 79 ------------------- files/fr/_redirects.txt | 3 +- files/fr/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 73 ++++++++++++++++++ .../operators/pipeline_operator/index.html | 73 ------------------ files/ja/_redirects.txt | 1 + files/ja/_wikihistory.json | 16 ++-- .../operators/pipeline_operator/index.html | 88 ++++++++++++++++++++++ .../operators/pipeline_operator/index.html | 87 --------------------- files/ko/_redirects.txt | 1 + files/ko/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 77 +++++++++++++++++++ .../operators/pipeline_operator/index.html | 76 ------------------- files/pl/_redirects.txt | 3 +- files/pl/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 66 ++++++++++++++++ .../operators/pipeline_operator/index.html | 66 ---------------- files/pt-br/_redirects.txt | 1 + files/pt-br/_wikihistory.json | 12 +-- .../operators/pipeline_operator/index.html | 66 ++++++++++++++++ .../operators/pipeline_operator/index.html | 65 ---------------- files/ru/_redirects.txt | 3 +- files/ru/_wikihistory.json | 14 ++-- .../operators/pipeline_operator/index.html | 78 +++++++++++++++++++ .../operators/pipeline_operator/index.html | 78 ------------------- files/zh-cn/_redirects.txt | 3 +- files/zh-cn/_wikihistory.json | 20 ++--- .../operators/pipeline_operator/index.html | 76 +++++++++++++++++++ .../operators/pipeline_operator/index.html | 76 ------------------- 36 files changed, 746 insertions(+), 733 deletions(-) create mode 100644 files/de/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/de/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/es/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/es/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/fr/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/fr/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/ja/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/ja/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/ko/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/ko/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/pl/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/pl/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/pt-br/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/pt-br/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/ru/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/ru/web/javascript/reference/operators/pipeline_operator/index.html create mode 100644 files/zh-cn/orphaned/web/javascript/reference/operators/pipeline_operator/index.html delete mode 100644 files/zh-cn/web/javascript/reference/operators/pipeline_operator/index.html (limited to 'files') diff --git a/files/de/_redirects.txt b/files/de/_redirects.txt index 1c8a7889f3..b5a8e00f50 100644 --- a/files/de/_redirects.txt +++ b/files/de/_redirects.txt @@ -872,6 +872,7 @@ /de/docs/Web/JavaScript/Reference/Operators/Modulo /de/docs/Web/JavaScript/Reference/Operators/Remainder /de/docs/Web/JavaScript/Reference/Operators/Objekt_Initialisierer /de/docs/Web/JavaScript/Reference/Operators/Object_initializer /de/docs/Web/JavaScript/Reference/Operators/Optionale_Verkettung /de/docs/Web/JavaScript/Reference/Operators/Optional_chaining +/de/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /de/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /de/docs/Web/JavaScript/Reference/Operators/Spread_operator /de/docs/conflicting/Web/JavaScript/Reference/Operators/Spread_syntax /de/docs/Web/JavaScript/Reference/Operators/Vergleichsoperatoren /de/docs/conflicting/Web/JavaScript/Reference/Operators_5b3986b830cf68059c03079ef10ff039 /de/docs/Web/JavaScript/Reference/Operators/Zuweisungsoperator /de/docs/conflicting/Web/JavaScript/Reference/Operators_bf514126b51a6e9b7591809ecc554076 diff --git a/files/de/_wikihistory.json b/files/de/_wikihistory.json index a3fbab39b8..3422f470b6 100644 --- a/files/de/_wikihistory.json +++ b/files/de/_wikihistory.json @@ -13247,12 +13247,6 @@ "TorbenKoehn" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:05:45.089Z", - "contributors": [ - "schlagi123" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-10-15T21:55:35.876Z", "contributors": [ @@ -14808,5 +14802,11 @@ "contributors": [ "schlagi123" ] + }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:05:45.089Z", + "contributors": [ + "schlagi123" + ] } } diff --git a/files/de/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/de/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..ce6a4024af --- /dev/null +++ b/files/de/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,68 @@ +--- +title: Pipeline Operator +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Experimental + - JavaScript + - Operator +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

Der experimentelle Pipline Operator |> (aktuell in Stage 1) erlaubt es verkettete Funktionsaufrufe in einer Lesbaren form zu erstellen. Grundsätzlich ist der Pipline Operator syntaktischer Zucker für den Aufruf einer Funktion mit einem Argument. Er erlaubt es

+ +

'%21' |> decodeURI statt decodeURI('%21') zu schreiben.

+ +

Syntax

+ +
expression |> function
+ +

Beispiele

+ +

Verkettete Funktionsaufrufe

+ +

Der Pipline Operator kann die Lesbarkeit von verketteten Funktionsaufrufen verbessern.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// Ohne Pipeline Operator
+double(increment(double(double(5)))); // 42
+
+// mit Pipeline Operator
+5 |> double |> double |> increment |> double; // 42
+
+ +

Spezifikationen

+ + + + + + + + + + + + + + + + +
SpezifikationStatusKommentar
Pipeline operator draftStage 1Kein Teil der ECMAScript Spezifikation.
+ +

Browserkompatibilität

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

Siehe auch

+ + diff --git a/files/de/web/javascript/reference/operators/pipeline_operator/index.html b/files/de/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 653e1a859d..0000000000 --- a/files/de/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: Pipeline Operator -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Experimental - - JavaScript - - Operator -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

Der experimentelle Pipline Operator |> (aktuell in Stage 1) erlaubt es verkettete Funktionsaufrufe in einer Lesbaren form zu erstellen. Grundsätzlich ist der Pipline Operator syntaktischer Zucker für den Aufruf einer Funktion mit einem Argument. Er erlaubt es

- -

'%21' |> decodeURI statt decodeURI('%21') zu schreiben.

- -

Syntax

- -
expression |> function
- -

Beispiele

- -

Verkettete Funktionsaufrufe

- -

Der Pipline Operator kann die Lesbarkeit von verketteten Funktionsaufrufen verbessern.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// Ohne Pipeline Operator
-double(increment(double(double(5)))); // 42
-
-// mit Pipeline Operator
-5 |> double |> double |> increment |> double; // 42
-
- -

Spezifikationen

- - - - - - - - - - - - - - - - -
SpezifikationStatusKommentar
Pipeline operator draftStage 1Kein Teil der ECMAScript Spezifikation.
- -

Browserkompatibilität

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

Siehe auch

- - diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index d63ef58754..841b47bad9 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -2401,6 +2401,7 @@ /es/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor /es/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor /es/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set /es/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/set /es/docs/Web/JavaScript/Reference/Global_Objects/RangeError/prototype /es/docs/conflicting/Web/JavaScript/Reference/Global_Objects/RangeError +/es/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /es/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /es/docs/Web/JavaScript/Referencia /es/docs/Web/JavaScript/Reference /es/docs/Web/JavaScript/Referencia/Acerca_de /es/docs/Web/JavaScript/Reference/About /es/docs/Web/JavaScript/Referencia/Características_Desaprobadas /es/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features @@ -2797,7 +2798,7 @@ /es/docs/Web/JavaScript/Referencia/Operadores/Operadores_especiales/Operador_this /es/docs/Web/JavaScript/Reference/Operators/this /es/docs/Web/JavaScript/Referencia/Operadores/Operadores_lógicos /es/docs/conflicting/Web/JavaScript/Reference/Operators_e72d8790e25513408a18a5826660f704 /es/docs/Web/JavaScript/Referencia/Operadores/Operator_Precedence /es/docs/Web/JavaScript/Reference/Operators/Operator_Precedence -/es/docs/Web/JavaScript/Referencia/Operadores/Pipeline_operator /es/docs/Web/JavaScript/Reference/Operators/Pipeline_operator +/es/docs/Web/JavaScript/Referencia/Operadores/Pipeline_operator /es/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /es/docs/Web/JavaScript/Referencia/Operadores/Resto /es/docs/Web/JavaScript/Reference/Operators/Remainder /es/docs/Web/JavaScript/Referencia/Operadores/Sintaxis_Spread /es/docs/Web/JavaScript/Reference/Operators/Spread_syntax /es/docs/Web/JavaScript/Referencia/Operadores/Spread_operator /es/docs/conflicting/Web/JavaScript/Reference/Operators/Spread_syntax diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index 3ffc1ff3a1..b64fc45ccc 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -20530,12 +20530,6 @@ "glrodasz" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:24:00.271Z", - "contributors": [ - "nachofelpete" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-03-12T19:37:28.144Z", "contributors": [ @@ -23666,6 +23660,12 @@ "humbertaco" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:24:00.271Z", + "contributors": [ + "nachofelpete" + ] + }, "orphaned/Web/SVG/SVG_en_Firefox_1.5": { "modified": "2019-03-23T23:42:07.791Z", "contributors": [ diff --git a/files/es/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/es/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..3646542103 --- /dev/null +++ b/files/es/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,79 @@ +--- +title: Operador Pipeline +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Encadenamiento + - Experimental + - JavaScript + - Operador + - Pipeline +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

El operador experimental pipeline |> (actualmente en su fase1) conduce el valor de una expresión dentro de una función. Esto permite la creación de llamadas de función en cadena de un modo más legible. El resultado es una simplificación sintáctica en la cual la llamada a una función con un único parámetro puede ser escrita del siguiente modo:

+ +
let url = "%21" |> decodeURI;
+ +

La llamada equivalente en sintaxis tradicional tiene este aspecto:

+ +
let url = decodeURI("%21");
+
+ +

Sintaxis

+ +
expression |> function
+
+ +

El valor especificado en la expression se pasa dentro de la  function como su único parámetro.

+ +

Ejemplos

+ +

Encadenando llamadas  a funciones

+ +

El operador pipeline puede mejorar la legibilidad cuando se encadenan varias funciones entre si.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// sin operador pipeline
+double(increment(double(double(5)))); // 42
+
+// con operador pipeline
+5 |> double |> double |> increment |> double; // 42
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
Borrador del operador PipelineFase 1Todavía no forma parte de la especificación ECMAScript
+ +

Compatibilidad con navegadores

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

Ver también

+ + diff --git a/files/es/web/javascript/reference/operators/pipeline_operator/index.html b/files/es/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 60b1de0858..0000000000 --- a/files/es/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Operador Pipeline -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Encadenamiento - - Experimental - - JavaScript - - Operador - - Pipeline -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator -original_slug: Web/JavaScript/Referencia/Operadores/Pipeline_operator ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

El operador experimental pipeline |> (actualmente en su fase1) conduce el valor de una expresión dentro de una función. Esto permite la creación de llamadas de función en cadena de un modo más legible. El resultado es una simplificación sintáctica en la cual la llamada a una función con un único parámetro puede ser escrita del siguiente modo:

- -
let url = "%21" |> decodeURI;
- -

La llamada equivalente en sintaxis tradicional tiene este aspecto:

- -
let url = decodeURI("%21");
-
- -

Sintaxis

- -
expression |> function
-
- -

El valor especificado en la expression se pasa dentro de la  function como su único parámetro.

- -

Ejemplos

- -

Encadenando llamadas  a funciones

- -

El operador pipeline puede mejorar la legibilidad cuando se encadenan varias funciones entre si.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// sin operador pipeline
-double(increment(double(double(5)))); // 42
-
-// con operador pipeline
-5 |> double |> double |> increment |> double; // 42
-
- -

Especificaciones

- - - - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
Borrador del operador PipelineFase 1Todavía no forma parte de la especificación ECMAScript
- -

Compatibilidad con navegadores

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

Ver también

- - diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 311dd1cdf9..443db37789 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -5522,6 +5522,7 @@ /fr/docs/Web/JavaScript/Reference/Objets_globaux/undefined /fr/docs/Web/JavaScript/Reference/Global_Objects/undefined /fr/docs/Web/JavaScript/Reference/Objets_globaux/unescape /fr/docs/Web/JavaScript/Reference/Global_Objects/unescape /fr/docs/Web/JavaScript/Reference/Objets_globaux/uneval /fr/docs/Web/JavaScript/Reference/Global_Objects/uneval +/fr/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /fr/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /fr/docs/Web/JavaScript/Reference/Opérateurs /fr/docs/Web/JavaScript/Reference/Operators /fr/docs/Web/JavaScript/Reference/Opérateurs/Addition /fr/docs/Web/JavaScript/Reference/Operators/Addition /fr/docs/Web/JavaScript/Reference/Opérateurs/Addition_avec_assignement /fr/docs/Web/JavaScript/Reference/Operators/Addition_assignment @@ -5552,7 +5553,7 @@ /fr/docs/Web/JavaScript/Reference/Opérateurs/Opérateurs_logiques /fr/docs/conflicting/Web/JavaScript/Reference/Operators_d0fb75b0fac950a91a017a1f497c6a1f /fr/docs/Web/JavaScript/Reference/Opérateurs/Précédence_des_opérateurs /fr/docs/Web/JavaScript/Reference/Operators/Operator_Precedence /fr/docs/Web/JavaScript/Reference/Opérateurs/Syntaxe_décomposition /fr/docs/Web/JavaScript/Reference/Operators/Spread_syntax -/fr/docs/Web/JavaScript/Reference/Opérateurs/Tube /fr/docs/Web/JavaScript/Reference/Operators/Pipeline_operator +/fr/docs/Web/JavaScript/Reference/Opérateurs/Tube /fr/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /fr/docs/Web/JavaScript/Reference/Opérateurs/async_function /fr/docs/Web/JavaScript/Reference/Operators/async_function /fr/docs/Web/JavaScript/Reference/Opérateurs/await /fr/docs/Web/JavaScript/Reference/Operators/await /fr/docs/Web/JavaScript/Reference/Opérateurs/class /fr/docs/Web/JavaScript/Reference/Operators/class diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index dce94aa003..5eae6a86f7 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -40432,12 +40432,6 @@ "SphinxKnight" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T21:59:06.221Z", - "contributors": [ - "SphinxKnight" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-10-15T21:16:58.418Z", "contributors": [ @@ -45269,5 +45263,11 @@ "contributors": [ "SphinxKnight" ] + }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T21:59:06.221Z", + "contributors": [ + "SphinxKnight" + ] } } diff --git a/files/fr/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/fr/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..0e9a34c8eb --- /dev/null +++ b/files/fr/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,73 @@ +--- +title: Tube +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Experimental + - JavaScript + - Opérateur + - Reference +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

L'opérateur expérimental tube (ou pipeline en anglais) |> (actuellement au niveau 1 des propositions) permet de créer des chaînes d'appel de fonctions de façon lisible. En fait, cet opérateur fournit un sucre syntaxique pour les appels de fonction avec un seul argument. On pourrait donc écrire :

+ +
let url = "%21%" |> decodeURI;
+ +

qui correspond exactement à :

+ +
let url = decodeURI("%21%");
+ +

Syntaxe

+ +
expression |> function
+ +

La valeur de expression est passé à function comme unique paramètre.

+ +

Exemples

+ +

Enchaîner des appels de fonction

+ +

L'opérateur tube peut améliorer la lisibilité lorsqu'on enchaîne plusieurs fonctions.

+ +
const doubler = (n) => n * 2;
+const incrementer = (n) => n + 1;
+
+// Sans l'opérateur tube
+doubler(incrementer(doubler(10))); // 42
+
+// Avec l'opérateur tube
+10 |> doubler |> incrementer |> doubler; // 42
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
Brouillon de spécification pour la proposition de l'opérateur tubeNiveau 1Ne fait actuellement pas partie de la spécification ECMAScript.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.operators.pipeline")}}

+ +

Voir aussi

+ + diff --git a/files/fr/web/javascript/reference/operators/pipeline_operator/index.html b/files/fr/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 78d9c2f704..0000000000 --- a/files/fr/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Tube -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Experimental - - JavaScript - - Opérateur - - Reference -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator -original_slug: Web/JavaScript/Reference/Opérateurs/Tube ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

L'opérateur expérimental tube (ou pipeline en anglais) |> (actuellement au niveau 1 des propositions) permet de créer des chaînes d'appel de fonctions de façon lisible. En fait, cet opérateur fournit un sucre syntaxique pour les appels de fonction avec un seul argument. On pourrait donc écrire :

- -
let url = "%21%" |> decodeURI;
- -

qui correspond exactement à :

- -
let url = decodeURI("%21%");
- -

Syntaxe

- -
expression |> function
- -

La valeur de expression est passé à function comme unique paramètre.

- -

Exemples

- -

Enchaîner des appels de fonction

- -

L'opérateur tube peut améliorer la lisibilité lorsqu'on enchaîne plusieurs fonctions.

- -
const doubler = (n) => n * 2;
-const incrementer = (n) => n + 1;
-
-// Sans l'opérateur tube
-doubler(incrementer(doubler(10))); // 42
-
-// Avec l'opérateur tube
-10 |> doubler |> incrementer |> doubler; // 42
-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
Brouillon de spécification pour la proposition de l'opérateur tubeNiveau 1Ne fait actuellement pas partie de la spécification ECMAScript.
- -

Compatibilité des navigateurs

- - - -

{{Compat("javascript.operators.pipeline")}}

- -

Voir aussi

- - diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 405f7e6619..c4834b1a87 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -4981,6 +4981,7 @@ /ja/docs/Web/JavaScript/Reference/Operators/Comparison_Operators /ja/docs/conflicting/Web/JavaScript/Reference/Operators /ja/docs/Web/JavaScript/Reference/Operators/Logical_Operators /ja/docs/Web/JavaScript/Reference/Operators /ja/docs/Web/JavaScript/Reference/Operators/Member_Operators /ja/docs/Web/JavaScript/Reference/Operators/Property_Accessors +/ja/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /ja/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /ja/docs/Web/JavaScript/Reference/Operators/Special /ja/docs/orphaned/Web/JavaScript/Reference/Operators/Special /ja/docs/Web/JavaScript/Reference/Operators/Special/get /ja/docs/Web/JavaScript/Reference/Functions/get /ja/docs/Web/JavaScript/Reference/Operators/Special_Operators /ja/docs/orphaned/Web/JavaScript/Reference/Operators/Special_Operators diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index 8871adaacb..ab35d6cc64 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -45589,14 +45589,6 @@ "hiroto7" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-17T14:59:10.566Z", - "contributors": [ - "mpcjazz", - "mfuji09", - "YuichiNukiyama" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-10-15T21:06:24.472Z", "contributors": [ @@ -53227,6 +53219,14 @@ "shide55" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-17T14:59:10.566Z", + "contributors": [ + "mpcjazz", + "mfuji09", + "YuichiNukiyama" + ] + }, "orphaned/Web/JavaScript/Reference/Operators/Special": { "modified": "2019-01-16T13:14:28.710Z", "contributors": [ diff --git a/files/ja/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/ja/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..62a25f0673 --- /dev/null +++ b/files/ja/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,88 @@ +--- +title: パイプライン演算子 (|>) +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Chaining + - Experimental + - JavaScript + - Language feature + - Operator + - Pipeline + - パイプライン + - 実験的 + - 演算子 + - 言語機能 + - 連結 +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}}
+ +

実験的なパイプライン演算子 |> (現在はステージ 1 です) は、式の値を関数に接続します。これによって、読みやすい方法で一連の関数呼び出しを作成することができます。結果的に、単一の引数を用いた関数呼び出しの糖衣構文となり、次のように書くことができます。

+ +
let url = "%21" |> decodeURI;
+ +

これと等価な従来の構文は次のようになります。

+ +
let url = decodeURI("%21");
+
+ +

構文

+ +
expression |> function
+
+ +

指定された expression の値が function に、単一の引数として渡されます。

+ +

引数

+ +
+
expression
+
任意の式です。
+
function
+
任意の関数です。
+
+ +

+ +

関数呼び出しの連結

+ +

パイプライン演算子は、複数の関数の連結を読みやすくすることができます。

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// パイプライン演算子なし
+double(increment(double(double(5)))); // 42
+
+// パイプライン演算子あり
+5 |> double |> double |> increment |> double; // 42
+
+ +

仕様

+ + + + + + + + + + + + +
仕様書
{{SpecName('Pipeline operator', '#sec-intro', 'Pipeline operator')}}
+ +

ブラウザー実装状況

+ + + +

{{Compat("javascript.operators.pipeline")}}

+ +

関連情報

+ + diff --git a/files/ja/web/javascript/reference/operators/pipeline_operator/index.html b/files/ja/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 02cbc7d0ba..0000000000 --- a/files/ja/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: パイプライン演算子 (|>) -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Chaining - - Experimental - - JavaScript - - Language feature - - Operator - - Pipeline - - パイプライン - - 実験的 - - 演算子 - - 言語機能 - - 連結 -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator ---- -
{{jsSidebar("Operators")}}
- -

実験的なパイプライン演算子 |> (現在はステージ 1 です) は、式の値を関数に接続します。これによって、読みやすい方法で一連の関数呼び出しを作成することができます。結果的に、単一の引数を用いた関数呼び出しの糖衣構文となり、次のように書くことができます。

- -
let url = "%21" |> decodeURI;
- -

これと等価な従来の構文は次のようになります。

- -
let url = decodeURI("%21");
-
- -

構文

- -
expression |> function
-
- -

指定された expression の値が function に、単一の引数として渡されます。

- -

引数

- -
-
expression
-
任意の式です。
-
function
-
任意の関数です。
-
- -

- -

関数呼び出しの連結

- -

パイプライン演算子は、複数の関数の連結を読みやすくすることができます。

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// パイプライン演算子なし
-double(increment(double(double(5)))); // 42
-
-// パイプライン演算子あり
-5 |> double |> double |> increment |> double; // 42
-
- -

仕様

- - - - - - - - - - - - -
仕様書
{{SpecName('Pipeline operator', '#sec-intro', 'Pipeline operator')}}
- -

ブラウザー実装状況

- - - -

{{Compat("javascript.operators.pipeline")}}

- -

関連情報

- - diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index 0a073302eb..5b0ebefecb 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -921,6 +921,7 @@ /ko/docs/Web/JavaScript/Reference/Operators/Assignment_Operators /ko/docs/conflicting/Web/JavaScript/Reference/Operators_8d54701de06af40a7c984517cbe87b3e /ko/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators /ko/docs/conflicting/Web/JavaScript/Reference/Operators_7c8eb9475d97a4a734c5991857698560 /ko/docs/Web/JavaScript/Reference/Operators/Comparison_Operators /ko/docs/conflicting/Web/JavaScript/Reference/Operators_310dc67549939233c3d18a8fa2cdbb23 +/ko/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /ko/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /ko/docs/Web/JavaScript/Reference/Operators/Special_Operators /ko/docs/Web/JavaScript/Reference/Operators /ko/docs/Web/JavaScript/Reference/Operators/Spread_operator /ko/docs/Web/JavaScript/Reference/Operators/Spread_syntax /ko/docs/Web/JavaScript/Reference/Operators/논리_연산자(Logical_Operators) /ko/docs/conflicting/Web/JavaScript/Reference/Operators_13aeb53e31f9cec454ca631cb162449f diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index 49b9cad561..da7b9258ed 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -15928,12 +15928,6 @@ "Jung.Kyu-Hyun" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:15:31.566Z", - "contributors": [ - "alattalatta" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-10-15T21:46:18.602Z", "contributors": [ @@ -18635,6 +18629,12 @@ "alattalatta" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:15:31.566Z", + "contributors": [ + "alattalatta" + ] + }, "orphaned/Web/Security/Information_Security_Basics": { "modified": "2019-03-23T22:05:46.762Z", "contributors": [ diff --git a/files/ko/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/ko/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..1202a44bff --- /dev/null +++ b/files/ko/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,77 @@ +--- +title: 파이프 연산자 +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Experimental + - JavaScript + - Operator +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

파이프 연산자(|>)는 실험적 기능(stage 1)으로, 표현식의 값을 함수에 전달합니다. 파이프 연산자를 활용하면 중첩 함수 호출을 좀 더 읽기 좋은 형식으로 작성할 수 있습니다. 결과물은 문법적 설탕syntactic sugar으로, 하나의 인수를 제공하는 함수 호출은 다음 코드처럼 쓸 수 있습니다.

+ +
let url = "%21" |> decodeURI;
+ +

전통적인 구문에서는 아래처럼 호출합니다.

+ +
let url = decodeURI("%21");
+
+ +

구문

+ +
expression |> function
+
+ +

지정한 expression의 값이 function의 유일한 매개변수로 전달됩니다.

+ +

예제

+ +

함수 체이닝

+ +

파이프 연산자를 사용해, 여러 번 중첩된 함수 호출을 읽기 편한 형태로 바꿀 수 있습니다.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// 파이프 연산자 없이
+double(increment(double(double(5)))); // 42
+
+// 파이프 연산자 사용
+5 |> double |> double |> increment |> double; // 42
+
+ +

명세

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
Pipeline operator draftStage 1Not part of the ECMAScript specification yet.
+ +

브라우저 호환성

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

같이 보기

+ + diff --git a/files/ko/web/javascript/reference/operators/pipeline_operator/index.html b/files/ko/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 42eb62e545..0000000000 --- a/files/ko/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: 파이프 연산자 -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Experimental - - JavaScript - - Operator -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

파이프 연산자(|>)는 실험적 기능(stage 1)으로, 표현식의 값을 함수에 전달합니다. 파이프 연산자를 활용하면 중첩 함수 호출을 좀 더 읽기 좋은 형식으로 작성할 수 있습니다. 결과물은 문법적 설탕syntactic sugar으로, 하나의 인수를 제공하는 함수 호출은 다음 코드처럼 쓸 수 있습니다.

- -
let url = "%21" |> decodeURI;
- -

전통적인 구문에서는 아래처럼 호출합니다.

- -
let url = decodeURI("%21");
-
- -

구문

- -
expression |> function
-
- -

지정한 expression의 값이 function의 유일한 매개변수로 전달됩니다.

- -

예제

- -

함수 체이닝

- -

파이프 연산자를 사용해, 여러 번 중첩된 함수 호출을 읽기 편한 형태로 바꿀 수 있습니다.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// 파이프 연산자 없이
-double(increment(double(double(5)))); // 42
-
-// 파이프 연산자 사용
-5 |> double |> double |> increment |> double; // 42
-
- -

명세

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
Pipeline operator draftStage 1Not part of the ECMAScript specification yet.
- -

브라우저 호환성

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

같이 보기

- - diff --git a/files/pl/_redirects.txt b/files/pl/_redirects.txt index e4306146e5..a6a06b0e0a 100644 --- a/files/pl/_redirects.txt +++ b/files/pl/_redirects.txt @@ -2504,6 +2504,7 @@ /pl/docs/Web/JavaScript/Reference/Errors/Brakujący_średnik_po_własności_id /pl/docs/Web/JavaScript/Reference/Errors/Missing_colon_after_property_id /pl/docs/Web/JavaScript/Reference/Functions/Funkcje_strzalkowe /pl/docs/Web/JavaScript/Reference/Functions/Arrow_functions /pl/docs/Web/JavaScript/Reference/Functions/Parametry_domyślne /pl/docs/Web/JavaScript/Reference/Functions/Default_parameters +/pl/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /pl/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /pl/docs/Web/JavaScript/Referencje /pl/docs/Web/JavaScript/Reference /pl/docs/Web/JavaScript/Referencje/Funkcje /pl/docs/Web/JavaScript/Reference/Global_Objects /pl/docs/Web/JavaScript/Referencje/Funkcje/Boolean /pl/docs/Web/JavaScript/Reference/Global_Objects/Boolean @@ -2799,7 +2800,7 @@ /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_in /pl/docs/Web/JavaScript/Reference/Operators/in /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_instanceof /pl/docs/Web/JavaScript/Reference/Operators/instanceof /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_new /pl/docs/Web/JavaScript/Reference/Operators/new -/pl/docs/Web/JavaScript/Referencje/Operatory/Operator_potoku /pl/docs/Web/JavaScript/Reference/Operators/Pipeline_operator +/pl/docs/Web/JavaScript/Referencje/Operatory/Operator_potoku /pl/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_przecinkowy /pl/docs/Web/JavaScript/Reference/Operators/Comma_Operator /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_typeof /pl/docs/Web/JavaScript/Reference/Operators/typeof /pl/docs/Web/JavaScript/Referencje/Operatory/Operator_void /pl/docs/Web/JavaScript/Reference/Operators/void diff --git a/files/pl/_wikihistory.json b/files/pl/_wikihistory.json index 2b50a0a549..da640bc203 100644 --- a/files/pl/_wikihistory.json +++ b/files/pl/_wikihistory.json @@ -9071,12 +9071,6 @@ "Internauta1024A" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:08:04.976Z", - "contributors": [ - "jangromko" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-03-12T19:36:58.666Z", "contributors": [ @@ -11672,6 +11666,12 @@ "Ptak82" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:08:04.976Z", + "contributors": [ + "jangromko" + ] + }, "orphaned/Web/JavaScript/Referencje/O_tym_dokumencie/Konwencje_formatowania_tekstu": { "modified": "2019-03-24T00:03:10.475Z", "contributors": [ diff --git a/files/pl/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/pl/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..fd379e7147 --- /dev/null +++ b/files/pl/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,66 @@ +--- +title: Operator potoku +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - JavaScript + - Operator + - ekxperymentalny +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +
Eskperymentalny operator potoku |> (obecnie na pierwszym etapie testów) pozwala na tworzenie łańcuchów wywołań funkcji w czytelny sposób. Dodaje lukier syntaktyczny do wywołania funkcji z pojedynczym argumentem, pozwalając przykładowo na pisanie '%21' |> decodeURI zamiast decodeURI('%21').
+ +

Składnia

+ +
wyrażenie |> funkcja
+ +

Przykłady

+ +

Łańcuchowe wywołania funkcji

+ +

Operator potoku może poprawić czytelność kodu przy łańcuchowych wywołaniach wielu funkcji.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// bez operatora potoku
+double(increment(double(double(5)))); // 42
+
+// z użyciem potoku
+5 |> double |> double |> increment |> double; // 42
+
+ +

Specyfikacje

+ + + + + + + + + + + + + + + + +
SpecyfikacjaStatusUwagi
Pipeline operator draftStage 1Nie jest jeszcze częścią specyfikacji ECMAScript.
+ +

Wsparcie przeglądarek

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

Zobacz też

+ + diff --git a/files/pl/web/javascript/reference/operators/pipeline_operator/index.html b/files/pl/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 6f62fbda6d..0000000000 --- a/files/pl/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Operator potoku -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - JavaScript - - Operator - - ekxperymentalny -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator -original_slug: Web/JavaScript/Referencje/Operatory/Operator_potoku ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -
Eskperymentalny operator potoku |> (obecnie na pierwszym etapie testów) pozwala na tworzenie łańcuchów wywołań funkcji w czytelny sposób. Dodaje lukier syntaktyczny do wywołania funkcji z pojedynczym argumentem, pozwalając przykładowo na pisanie '%21' |> decodeURI zamiast decodeURI('%21').
- -

Składnia

- -
wyrażenie |> funkcja
- -

Przykłady

- -

Łańcuchowe wywołania funkcji

- -

Operator potoku może poprawić czytelność kodu przy łańcuchowych wywołaniach wielu funkcji.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// bez operatora potoku
-double(increment(double(double(5)))); // 42
-
-// z użyciem potoku
-5 |> double |> double |> increment |> double; // 42
-
- -

Specyfikacje

- - - - - - - - - - - - - - - - -
SpecyfikacjaStatusUwagi
Pipeline operator draftStage 1Nie jest jeszcze częścią specyfikacji ECMAScript.
- -

Wsparcie przeglądarek

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

Zobacz też

- - diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 631aaa1fcd..2359ac805e 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -854,6 +854,7 @@ /pt-BR/docs/Web/JavaScript/Reference/Operators/Operador_Virgula /pt-BR/docs/Web/JavaScript/Reference/Operators/Comma_Operator /pt-BR/docs/Web/JavaScript/Reference/Operators/Operadores_Logicos /pt-BR/docs/conflicting/Web/JavaScript/Reference/Operators_8fa8b34b0547a749514637a15d386886 /pt-BR/docs/Web/JavaScript/Reference/Operators/Operadores_de_comparação /pt-BR/docs/conflicting/Web/JavaScript/Reference/Operators_0d2e4b8154642b5a9dbd76a2a48cf96a +/pt-BR/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /pt-BR/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /pt-BR/docs/Web/JavaScript/Reference/Operators/Spread_operator /pt-BR/docs/conflicting/Web/JavaScript/Reference/Operators/Spread_syntax /pt-BR/docs/Web/JavaScript/Reference/Operators/operador_de_coalescencia_nula /pt-BR/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator /pt-BR/docs/Web/JavaScript/Reference/Properties_Index /pt-BR/docs/Web/JavaScript/Reference diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index 02cd6c4001..1dcad77dd8 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -15397,12 +15397,6 @@ "agusmao720919" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:12:37.977Z", - "contributors": [ - "murillodmiranda" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-03-12T19:44:40.050Z", "contributors": [ @@ -17330,6 +17324,12 @@ "LuisAraujo" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:12:37.977Z", + "contributors": [ + "murillodmiranda" + ] + }, "orphaned/Web/SVG/Element/color-profile": { "modified": "2019-03-23T22:57:13.667Z", "contributors": [ 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 +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

O operador experimental pipeline |> (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

+ +

'%21' |> decodeURI ao invés de decodeURI('%21').

+ +

Sintaxe

+ +
expressão |> função
+ +

Exemplos

+ +

Chamadas de funções encadeadas

+ +

 

+ +

O operador de pipeline pode melhorar a legibilidade ao encadear várias funções.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// sem o perador pipeline
+double(increment(double(double(5)))); // 42
+
+// com o operador pipeline
+5 |> double |> double |> increment |> double; // 42
+
+ +

Especificações

+ + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
Pipeline operator draftEstágio 1Não faz parte da especificação ECMAScript ainda.
+ +

Compatibilidade com os navegadores

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

Ver também

+ + diff --git a/files/pt-br/web/javascript/reference/operators/pipeline_operator/index.html b/files/pt-br/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 9de22603c9..0000000000 --- a/files/pt-br/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Operador Pipeline -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

O operador experimental pipeline |> (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

- -

'%21' |> decodeURI ao invés de decodeURI('%21').

- -

Sintaxe

- -
expressão |> função
- -

Exemplos

- -

Chamadas de funções encadeadas

- -

 

- -

O operador de pipeline pode melhorar a legibilidade ao encadear várias funções.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// sem o perador pipeline
-double(increment(double(double(5)))); // 42
-
-// com o operador pipeline
-5 |> double |> double |> increment |> double; // 42
-
- -

Especificações

- - - - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
Pipeline operator draftEstágio 1Não faz parte da especificação ECMAScript ainda.
- -

Compatibilidade com os navegadores

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

Ver também

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index e8606a2a38..5b8b92e802 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -780,9 +780,10 @@ /ru/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators /ru/docs/conflicting/Web/JavaScript/Reference/Operators /ru/docs/Web/JavaScript/Reference/Operators/Assignment_Operators /ru/docs/conflicting/Web/JavaScript/Reference/Operators_8d54701de06af40a7c984517cbe87b3e /ru/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators /ru/docs/conflicting/Web/JavaScript/Reference/Operators_7c8eb9475d97a4a734c5991857698560 +/ru/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /ru/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /ru/docs/Web/JavaScript/Reference/Operators/Spread_operator /ru/docs/Web/JavaScript/Reference/Operators/Spread_syntax /ru/docs/Web/JavaScript/Reference/Operators/Группировка /ru/docs/Web/JavaScript/Reference/Operators/Grouping -/ru/docs/Web/JavaScript/Reference/Operators/Конвейерный_оператор /ru/docs/Web/JavaScript/Reference/Operators/Pipeline_operator +/ru/docs/Web/JavaScript/Reference/Operators/Конвейерный_оператор /ru/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /ru/docs/Web/JavaScript/Reference/Operators/Логические_операторы /ru/docs/conflicting/Web/JavaScript/Reference/Operators_843c998343f0cdaa5699874c806d4cea /ru/docs/Web/JavaScript/Reference/Operators/Оператор_Запятая /ru/docs/Web/JavaScript/Reference/Operators/Comma_Operator /ru/docs/Web/JavaScript/Reference/Operators/Операторы_сравнения /ru/docs/conflicting/Web/JavaScript/Reference/Operators_69135a8d5772f8b6e45265523df05d89 diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index 25562288d5..46f8df7e43 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -22591,13 +22591,6 @@ "Dimon24021993" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T22:07:33.663Z", - "contributors": [ - "nakhodkiin", - "ALegostaeva" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-11-28T14:23:33.816Z", "contributors": [ @@ -25751,6 +25744,13 @@ "srvoland" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T22:07:33.663Z", + "contributors": [ + "nakhodkiin", + "ALegostaeva" + ] + }, "orphaned/Web/Manifest/serviceworker": { "modified": "2020-10-15T22:28:10.302Z", "contributors": [ diff --git a/files/ru/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/ru/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..808573314a --- /dev/null +++ b/files/ru/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,78 @@ +--- +title: Конвейерный оператор +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Experimental + - JavaScript + - Operator + - Оператор + - Экспериментальный +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

Экспериментальный конвейерный оператор |> (в настоящее время на этапе 1) позволяет создавать читаемые цепочки вызовов функций. В основном, конвейерный оператор предоставляет возможность вызова функции с одним аргументом, и позволяет написать:

+ +
let url = "%21" |> decodeURI;
+
+ +

Эквивалентный вызов в традиционном синтаксисе выглядит следующим образом:

+ +
let url = decodeURI("%21");
+
+ +

Синтаксис

+ +
выражение |> функция
+ +

Значение указанного выражения передаётся в функцию в качестве единственного параметра.

+ +

Примеры

+ +

Цепочки вызовов функций

+ +

Конвейерный оператор позволяет улучшить читаемость кода, в случае когда встречается цепочка из нескольких функций.

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// без конвейерного оператора
+double(increment(double(double(5)))); // 42
+
+// с конвейерным оператором
+5 |> double |> double |> increment |> double; // 42
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусComment
Pipeline operator draftЭтап 1Ещё не включён в спецификацию ECMAScript.
+ +

Совместимость с браузерами

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

Смотрите также

+ + diff --git a/files/ru/web/javascript/reference/operators/pipeline_operator/index.html b/files/ru/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index 3fee1a8a0d..0000000000 --- a/files/ru/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Конвейерный оператор -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Experimental - - JavaScript - - Operator - - Оператор - - Экспериментальный -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator -original_slug: Web/JavaScript/Reference/Operators/Конвейерный_оператор ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

Экспериментальный конвейерный оператор |> (в настоящее время на этапе 1) позволяет создавать читаемые цепочки вызовов функций. В основном, конвейерный оператор предоставляет возможность вызова функции с одним аргументом, и позволяет написать:

- -
let url = "%21" |> decodeURI;
-
- -

Эквивалентный вызов в традиционном синтаксисе выглядит следующим образом:

- -
let url = decodeURI("%21");
-
- -

Синтаксис

- -
выражение |> функция
- -

Значение указанного выражения передаётся в функцию в качестве единственного параметра.

- -

Примеры

- -

Цепочки вызовов функций

- -

Конвейерный оператор позволяет улучшить читаемость кода, в случае когда встречается цепочка из нескольких функций.

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// без конвейерного оператора
-double(increment(double(double(5)))); // 42
-
-// с конвейерным оператором
-5 |> double |> double |> increment |> double; // 42
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусComment
Pipeline operator draftЭтап 1Ещё не включён в спецификацию ECMAScript.
- -

Совместимость с браузерами

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

Смотрите также

- - diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 32e696949c..32a464ddf5 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -2580,6 +2580,7 @@ /zh-CN/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators /zh-CN/docs/conflicting/Web/JavaScript/Reference/Operators_7c8eb9475d97a4a734c5991857698560 /zh-CN/docs/Web/JavaScript/Reference/Operators/Comparison_Operators /zh-CN/docs/conflicting/Web/JavaScript/Reference/Operators_310dc67549939233c3d18a8fa2cdbb23 /zh-CN/docs/Web/JavaScript/Reference/Operators/Logical_Operators /zh-CN/docs/conflicting/Web/JavaScript/Reference/Operators_f71733c8e7001a29c3ec40d8522a4aca +/zh-CN/docs/Web/JavaScript/Reference/Operators/Pipeline_operator /zh-CN/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_operator /en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax /zh-CN/docs/Web/JavaScript/Reference/Operators/async允许声明一个函数为一个包含异步操作的函数 /zh-CN/docs/Web/JavaScript/Reference/Operators/async_function /zh-CN/docs/Web/JavaScript/Reference/Operators/取余 /zh-CN/docs/Web/JavaScript/Reference/Operators/Remainder @@ -2588,7 +2589,7 @@ /zh-CN/docs/Web/JavaScript/Reference/Operators/按位与 /zh-CN/docs/Web/JavaScript/Reference/Operators/Bitwise_AND /zh-CN/docs/Web/JavaScript/Reference/Operators/相加 /zh-CN/docs/Web/JavaScript/Reference/Operators/Addition /zh-CN/docs/Web/JavaScript/Reference/Operators/相等 /zh-CN/docs/Web/JavaScript/Reference/Operators/Equality -/zh-CN/docs/Web/JavaScript/Reference/Operators/管道操作符 /zh-CN/docs/Web/JavaScript/Reference/Operators/Pipeline_operator +/zh-CN/docs/Web/JavaScript/Reference/Operators/管道操作符 /zh-CN/docs/orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator /zh-CN/docs/Web/JavaScript/Reference/Operators/类 /zh-CN/docs/Web/JavaScript/Reference/Operators/class /zh-CN/docs/Web/JavaScript/Reference/Operators/自减 /zh-CN/docs/Web/JavaScript/Reference/Operators/Decrement /zh-CN/docs/Web/JavaScript/Reference/Operators/逻辑和 /zh-CN/docs/Web/JavaScript/Reference/Operators/Logical_AND diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 46ebaa388b..e289aa8522 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -44276,16 +44276,6 @@ "wsv587" ] }, - "Web/JavaScript/Reference/Operators/Pipeline_operator": { - "modified": "2020-10-15T21:59:15.552Z", - "contributors": [ - "RainSlide", - "fsy0718", - "zhangchen", - "qdlaoyao", - "fphonor" - ] - }, "Web/JavaScript/Reference/Operators/Property_Accessors": { "modified": "2020-10-15T21:37:38.990Z", "contributors": [ @@ -50694,6 +50684,16 @@ "Ende93" ] }, + "orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator": { + "modified": "2020-10-15T21:59:15.552Z", + "contributors": [ + "RainSlide", + "fsy0718", + "zhangchen", + "qdlaoyao", + "fphonor" + ] + }, "orphaned/Web/JavaScript/javascript(起步)": { "modified": "2019-03-23T22:54:49.824Z", "contributors": [ diff --git a/files/zh-cn/orphaned/web/javascript/reference/operators/pipeline_operator/index.html b/files/zh-cn/orphaned/web/javascript/reference/operators/pipeline_operator/index.html new file mode 100644 index 0000000000..12c3b6fbb3 --- /dev/null +++ b/files/zh-cn/orphaned/web/javascript/reference/operators/pipeline_operator/index.html @@ -0,0 +1,76 @@ +--- +title: 管道操作符 +slug: orphaned/Web/JavaScript/Reference/Operators/Pipeline_operator +tags: + - Experimental + - JavaScript + - Operator + - 语法糖 + - 链式 + - 链式调用 +translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator +original_slug: Web/JavaScript/Reference/Operators/Pipeline_operator +--- +
{{jsSidebar("Operators")}} {{SeeCompatTable}}
+ +

试验性的管道操作符 |> (目前其标准化流程处于 stage 1 阶段)允许以一种易读的方式去对函数链式调用。本质上来说,管道操作符是单参数函数调用的语法糖,它允许你像这样执行一个调用:

+ +
let url = "%21" |> decodeURI;
+ +

使用传统语法写的话,等效的代码是这样的:

+ +
let url = decodeURI("%21");
+
+ +

语法

+ +
expression |> function
+ +

例子

+ +

函数链式调用

+ +

当链式调用多个函数时,使用管道操作符可以改善代码的可读性。

+ +
const double = (n) => n * 2;
+const increment = (n) => n + 1;
+
+// 没有用管道操作符
+double(increment(double(5))); // 22
+
+// 用上管道操作符之后
+5 |> double |> increment |> double; // 22
+
+ +

规范

+ + + + + + + + + + + + + + + + +
规范状态备注
Pipeline operator draftStage 1Not part of the ECMAScript specification yet.
+ +

浏览器兼容性Edit

+ +
+ + +

{{Compat("javascript.operators.pipeline")}}

+
+ +

参见

+ + diff --git a/files/zh-cn/web/javascript/reference/operators/pipeline_operator/index.html b/files/zh-cn/web/javascript/reference/operators/pipeline_operator/index.html deleted file mode 100644 index d8087ba0e3..0000000000 --- a/files/zh-cn/web/javascript/reference/operators/pipeline_operator/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: 管道操作符 -slug: Web/JavaScript/Reference/Operators/Pipeline_operator -tags: - - Experimental - - JavaScript - - Operator - - 语法糖 - - 链式 - - 链式调用 -translation_of: Web/JavaScript/Reference/Operators/Pipeline_operator -original_slug: Web/JavaScript/Reference/Operators/管道操作符 ---- -
{{jsSidebar("Operators")}} {{SeeCompatTable}}
- -

试验性的管道操作符 |> (目前其标准化流程处于 stage 1 阶段)允许以一种易读的方式去对函数链式调用。本质上来说,管道操作符是单参数函数调用的语法糖,它允许你像这样执行一个调用:

- -
let url = "%21" |> decodeURI;
- -

使用传统语法写的话,等效的代码是这样的:

- -
let url = decodeURI("%21");
-
- -

语法

- -
expression |> function
- -

例子

- -

函数链式调用

- -

当链式调用多个函数时,使用管道操作符可以改善代码的可读性。

- -
const double = (n) => n * 2;
-const increment = (n) => n + 1;
-
-// 没有用管道操作符
-double(increment(double(5))); // 22
-
-// 用上管道操作符之后
-5 |> double |> increment |> double; // 22
-
- -

规范

- - - - - - - - - - - - - - - - -
规范状态备注
Pipeline operator draftStage 1Not part of the ECMAScript specification yet.
- -

浏览器兼容性Edit

- -
- - -

{{Compat("javascript.operators.pipeline")}}

-
- -

参见

- - -- cgit v1.2.3-54-g00ecf