/
Equality and Inequality Operators
Equality and Inequality Operators
In Lua, you can compare two variables to see if they are equal using the == equality operator. For instance:
-- single = to assign values to variables
local Variable1 = "Fred"
local Variable2 = "Mary"
local Variable3 = "Fred"
if (Variable1 == Variable3) then
trace("These variables are equal!")
end
Below are the comparison operators you can apply to compare variables:
== Equal to
~= Not equal to
< Less than
> Greater than
<= Lesser or equal to
>= Greater or equal to
See if statements for a simple example of applying these comparison operators.
, multiple selections available,
Related content
Block statements
Block statements
Read with this
Operators
Operators
More like this
Commit and Push Changes to Git
Commit and Push Changes to Git
Read with this
Example code showing the eight basic types in Lua
Example code showing the eight basic types in Lua
More like this
What is Source Control?
What is Source Control?
Read with this
Value Types
Value Types
More like this