-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
Description
The limitation is surely debatable, it was added to the language specification with the purpose to avoid programming mistakes, when people start to switch from || to ??.
from: nullish-coalescing-operator
How can it be possible to produce mistake while changing || to ?? . There is not any other operator between their precedence order.
| Precedence | Operator type | Associativity | Individual operators |
|---|---|---|---|
| 7 | Logical AND (&&) | left-to-right | … && … |
| -- | -- | -- | -- |
| 6 | Logical OR (||) | left-to-right | … || … |
| 5 | Nullish coalescing operator (??) | left-to-right | … ?? … |
from : MDN