lua and operator code example
Example 1: lua ternary
if a == nil then
b
else
c
end
This is the equivalent to:
a == nil and b or c
Example 2: lua operators
== -- Equal to whatever
<= -- Less than or equal to
>= -- Greater than or equal to
< -- Less than
> -- Greater Than
~= -- Doesnt equal
# -- Length of something
Example 3: lua operators
== equal to
~= not equal to
< less than
> greater than
<= less than or equal to
>= greater than or equal to
+ Addition
- Subtraction
* Multiplication
/ Division
^ Exponentiation
% Modulus
- Unary negation
Example 4: lua logical and
if 1 == 1 and 2 == 2 then
print("cool!")
end