User Tools

Site Tools


wiki:operators

A Few of My Favorite Conditional Operators

!+ My favorite knot! Actually, it's a “logical not,” meaning it checks for something to NOT be the case or not equal with something.

= A single equals sign assigns value.

= = A double equals sign doesn't assign anything. Instead, it checks equality. If you want to know if a variable is equal to a number, you could use this operator.

&& This is a “logical and.” If this is true &&AND that is true.

|| The “logical or” is a way of asking, “if this is true ||OR that is true…”

- = Subtracts one from a variable and assigns the variable the new value. So x -= 1 is another way of saying x = x - 1

++ Adds one to a variable and assigns the variable the new value. So x++ is another way of saying x = x + 1

wiki/operators.txt · Last modified: 2019/06/19 02:49 by paul