Lua ternary

This article is tagged with: Lua ternary and lua

lua ternary

if a == nil then
b
else
c
end
This is the equivalent to:
a == nil and b or c

This article is tagged with: Lua ternary and lua