Listing 18-2. Logical OR
let x = true
let y = false
let b = x || y
In Listing 18-2, the value of b would be true because one of the conditions
(x) is true.
You use logical NOT as indicated by ! to test for the opposite of a boolean
value. An exclamation point before a boolean value means the opposite of
the boolean value. So, !true means false, while !false means true.
If you wanted to test x to see what the opposite boolean value is, you could
do Listing 18-3.
Listing 18-3. Logical NOT
let x = true
let y = false
let c = !x
The c value in Listing 18-3 will be false since the value of x is true.