The logical operator "and" (
&&) is a way of saying you want to do something if one value AND another value are truthy. All comparisons in the statement must be truthy for the entire result to be truthy.
When evaluating an expression that uses the
Here's a table of when an expression table will result in what value given two comparisons:
truthy && truthy → truthy truthy && falsy → falsy falsy && truthy → falsy falsy && falsy → falsy
For more information on the logical or operator, read this blog post.