Either
Example
The following two print
statements have identical results.
Output: If Player 1 is admin, it will print "Player is an admin".
Example
A practical example of the behavior of this function in comparison to Lua's "pseudo" ternary operator, demonstrating short-circuit evaluation, and the lack of it when using Either
.
Output: printHello not called
Hello, world!
myCondition is true, but printHello was still called