From 4ed8b9df28c5b00c573ed0498ef1fb82a6f07ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=C2=A0Choi?= Date: Sat, 21 Aug 2021 23:48:29 -0400 Subject: [PATCH] =?UTF-8?q?explainer=20=C2=A7=C2=A0Description:=20Fix=20pr?= =?UTF-8?q?ecedence=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also remove link to MDN article with erroneous table. --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9420db3..7d515b1 100644 --- a/README.md +++ b/README.md @@ -468,7 +468,7 @@ then evaluates its righthand side (the **pipe body**) with that binding. The resulting value of the righthand side becomes the whole pipe expression’s final value (the **pipe output**). -The pipe operator’s [precedence][] is the **same** as: +The pipe operator’s precedence is the **same** as: * the function arrow `=>`; * the assignment operators `=`, `+=`, etc.; * the generator operators `yield` and `yield *`; @@ -493,7 +493,8 @@ is also **invalid syntax**. To prevent confusing grouping, it is **invalid** syntax to use **other** operators that have the **same precedence** -(the function arrow `=>`, the assignment operators, and the yield operators) +(the arrow `=>`, the ternary conditional operator `?` `:`, +the assignment operators, and the `yield` operator) as a **pipe head or body**. When using, we must use **parentheses** to explicitly indicate which precedence is correct. @@ -519,8 +520,6 @@ As usual, the comma expression will evaluate to its righthand side `%`, essentially passing through the topic value without modifying it. This is especially useful for quick debugging: `value |> (console.log(%), %)`. -[precedence]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence - ## Real-world examples Only minor formatting changes have been made to the status-quo examples.