rockstar-js
rockstar-js copied to clipboard
Logical operators (and/or/not/nor)
Rockstar has 4 different logical operators that first convert their operand(s) to a boolean by truthiness.
-
A and B
returns the Conjunction -
A or B
returns the Disjunction -
A nor B
returns the Joint Denial -
not A
returns the Negation of its single argument. All logical operators are short circuiting. This means if by evaluating the first argument to the operator guarantees a result, the other argument is not evaluated.false and 1 over 0
isfalse
and does not produce an error for dividing by zero.