Edit precedence of ??
and ||
Depends on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table, precedence of `??` and `||` should be 3 instead of 4
This commit is contained in:
parent
7000ede297
commit
4935538055
1 changed files with 1 additions and 1 deletions
|
@ -106,7 +106,7 @@ In practice, the zero height is often a valid value, that shouldn't be replaced
|
||||||
|
|
||||||
## Precedence
|
## Precedence
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
That means that, just like `||`, the nullish coalescing operator `??` is evaluated before `=` and `?`, but after most other operations, such as `+`, `*`.
|
That means that, just like `||`, the nullish coalescing operator `??` is evaluated before `=` and `?`, but after most other operations, such as `+`, `*`.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue