Grammatical edit (#19906)

pull/19908/head^2
joaquin fox 2018-10-29 12:20:29 -07:00 committed by Paul Gamble
parent 834e178e3f
commit b1b9014b52
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ console.log(c && a); // 'word'
``` ```
As you can see, the *or* operator checks the first operand. If this is true or truthy, it returns it immediately (which is why we get 'word' in the first case & true in the second case). If it is not true or truthy, it returns the second operand (which is why we get 'word' in the third case). As you can see, the *or* operator checks the first operand. If this is true or truthy, it returns it immediately (which is why we get 'word' in the first case & true in the second case). If it is not true or truthy, it returns the second operand (which is why we get 'word' in the third case).
With the and operator it works in a similar way, but for 'and' to be true, both operands need to be truthy. So it will always return the second operand if both are true/truthy, otherwise it will return false. That is why in the fourth case we get true and in the last case we get 'word'. The *and* operator works in a similar way, but for 'and' to be true, both operands need to be truthy. So it will always return the second operand if both are true/truthy, otherwise it will return false. That is why in the fourth case we get true and in the last case we get 'word'.
## The Boolean Object ## The Boolean Object