Merge pull request #1771 from detinsley1s/patch-1

Fix typo
This commit is contained in:
Ilya Kantor 2020-03-21 09:13:19 +03:00 committed by GitHub
commit 58d4329bb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ alert( alert(1) || 2 || alert(3) );
The call to `alert` does not return a value. Or, in other words, it returns `undefined`. The call to `alert` does not return a value. Or, in other words, it returns `undefined`.
1. The first OR `||` evaluates it's left operand `alert(1)`. That shows the first message with `1`. 1. The first OR `||` evaluates its left operand `alert(1)`. That shows the first message with `1`.
2. The `alert` returns `undefined`, so OR goes on to the second operand searching for a truthy value. 2. The `alert` returns `undefined`, so OR goes on to the second operand searching for a truthy value.
3. The second operand `2` is truthy, so the execution is halted, `2` is returned and then shown by the outer alert. 3. The second operand `2` is truthy, so the execution is halted, `2` is returned and then shown by the outer alert.