en.javascript.info/1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md
2018-10-07 10:30:37 +03:00

16 lines
262 B
Markdown

The answer: `3`.
```js run
alert( null || 2 && 3 || 4 );
```
The precedence of AND `&&` is higher than `||`, so it executes first.
The result of `2 && 3 = 3`, so the expression becomes:
```
null || 3 || 4
```
Now the result is the first truthy value: `3`.