Logical operations
There are some operations that can be done to booleans to combine or change their results.
!The not operator, it negates the boolean (
!trueequalfalseand!falseequalstrue).&&The and operator, it requires both booleans to be
true, else it returnsfalse(true&&trueequalstrue,true&&falseand any other combination equalsfalse).||The or operator, it requires any of the booleans to be true, it returns
falseif both arefalse(false||falseequalsfalse,true&&falseand any other combination equalstrue).
Last modified: 16 October 2024