Home »
Code Examples »
Lua Code Examples
Lua - Demonstrate the basic example of logical operators Code Example
The code for Demonstrate the basic example of logical operators
print(10 or 20)
print(10 or error)
print(nil or "a")
print(nil and 10)
print(false and error())
print(false and nil)
print(false or nil)
print(10 and 20)
--[[
Output:
10
10a
nil
false
false
nil
20
--]]
Code by IncludeHelp,
on August 25, 2022 22:45