July 2018
Beginner
202 pages
5h 42m
English
Relational operators compare two things (usually numbers) and always evaluate to a Boolean result. These operators are used to answer questions such as is 10 less than 20? Relational operators test for equality, inequality, and which of two arguments is less than or greater than the other.
The equality operator (==) checks whether the values of the two operands are equal or not. If they are equal, the operator evaluates to true, otherwise it evaluates to false. Here are examples:
x = 2 == 2 -- truey = 2 == 3 -- falsez = "nine" == 9 -- false
The inequality operator (~=) checks whether the values of the two operands are equal or not. If they are NOT equal, the operator evaluates to true, otherwise it evaluates to false ...