Logic operators allow us to do logic (and/or).
When to use
Whenever you need to compare more than one thing, use logic operators (and/or).
And (&&), Or (||), xor, allow us to compare more than one thing.
and (&&) both true to be true, otherwise false
or (||) one true to be true, otherwise false
xor only one can be true but not both
Hints & tips
- And (&&)
- Or (||)
Lesson notes are only available for subscribers.