Skip to content

Commit b923029

Browse files
authored
Merge pull request #3146 from SUPERustam/patch-1
Edit precedence of `??` and `||`
2 parents 7000ede + 4935538 commit b923029

File tree

1 file changed

+1
-1
lines changed
  • 1-js/02-first-steps/12-nullish-coalescing-operator

1 file changed

+1
-1
lines changed

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ In practice, the zero height is often a valid value, that shouldn't be replaced
106106
107107
## Precedence
108108
109-
The precedence of the `??` operator is the same as `||`. They both equal `4` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
109+
The precedence of the `??` operator is the same as `||`. They both equal `3` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
110110
111111
That means that, just like `||`, the nullish coalescing operator `??` is evaluated before `=` and `?`, but after most other operations, such as `+`, `*`.
112112

0 commit comments

Comments
 (0)