And operation
Learn how to check if all conditions are true.
The logical and operation evaluates to true when both operands are true and false otherwise.
To use the and operator, place a && sign between two expressions:
/*<value>*/ && /*<value>*/
For a more natural language feel, you can use and:
/*<value>*/ and /*<value>*/
Here is a practical example:
true and false // false
Note that the and operation has higher precedence than the or operation:
true or false and false
The above expression is equivalent to the following:
true or (false and false)
In other words, the and operator is evaluated first, and the result is used as the second operand of the or operator.