Correction to precedence levels

Nullish coalescing and logical OR both eqaul to 4 now in MDN table.
This commit is contained in:
Erol Aliyev 2022-01-22 19:13:44 +01:00 committed by GitHub
parent 1dc6dfbc7c
commit 674a9a417a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,7 @@ In practice, the zero height is often a valid value, that shouldn't be replaced
## Precedence
The precedence of the `??` operator is about the same as `||`, just a bit lower. It equals `5` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table), while `||` is `6`.
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).
That means that, just like `||`, the nullish coalescing operator `??` is evaluated before `=` and `?`, but after most other operations, such as `+`, `*`.