Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
explainer § Description: Fix precedence typo
Browse files Browse the repository at this point in the history
Also remove link to MDN article with erroneous table.
  • Loading branch information
js-choi authored Aug 22, 2021
1 parent 4eac55c commit 4ed8b9d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 *`;
Expand All @@ -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.
Expand All @@ -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.

Expand Down

0 comments on commit 4ed8b9d

Please sign in to comment.