Javascript - Logical operators
📖 Read the lesson
Code Life
By Pierre Marsaa
The AND Operator (&&)
The
logical AND operator
(
&&
) checks if
both
conditions are true. If both are true, the result is
true
. If even one is false, the result is
false
.
Think of it like this: Your Codémon can enter a tournament only if it has enough level AND enough health points. Both conditions must be met!
↗️
Loading editor...
↶
▶️ Run
↷
AND Truth Table
true && true
→
true
true && false
→
false
false && true
→
false
false && false
→
false
Both sides must be true to get true!
Verify