Lua - Logical Operators Code Example

The code for Logical Operators

The logical operators in Lua are and, or, and not.
Here are some examples:
     10 or 20            --> 10
     10 or error()       --> 10
     nil or "a"          --> "a"
     nil and 10          --> nil
     false and error()   --> false
     false and nil       --> false
     false or nil        --> nil
     10 and 20           --> 20
Code by IncludeHelp, on January 2, 2023 20:17

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.