Skip to content

Commit 15dacc1

Browse files
authored
Merge pull request #3117 from romanstetsyk/master
Update the operator precedence table
2 parents caaa05b + 69d180e commit 15dacc1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

1-js/02-first-steps/08-operators/article.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,18 @@ Here's an extract from the [precedence table](https://developer.mozilla.org/en-U
194194
| Precedence | Name | Sign |
195195
|------------|------|------|
196196
| ... | ... | ... |
197-
| 15 | unary plus | `+` |
198-
| 15 | unary negation | `-` |
199-
| 14 | exponentiation | `**` |
200-
| 13 | multiplication | `*` |
201-
| 13 | division | `/` |
202-
| 12 | addition | `+` |
203-
| 12 | subtraction | `-` |
197+
| 14 | unary plus | `+` |
198+
| 14 | unary negation | `-` |
199+
| 13 | exponentiation | `**` |
200+
| 12 | multiplication | `*` |
201+
| 12 | division | `/` |
202+
| 11 | addition | `+` |
203+
| 11 | subtraction | `-` |
204204
| ... | ... | ... |
205205
| 2 | assignment | `=` |
206206
| ... | ... | ... |
207207

208-
As we can see, the "unary plus" has a priority of `15` which is higher than the `12` of "addition" (binary plus). That's why, in the expression `"+apples + +oranges"`, unary pluses work before the addition.
208+
As we can see, the "unary plus" has a priority of `14` which is higher than the `11` of "addition" (binary plus). That's why, in the expression `"+apples + +oranges"`, unary pluses work before the addition.
209209
210210
## Assignment
211211

0 commit comments

Comments
 (0)