Answers for "lua how to default value if nil or false"

Lua
0

lua how to default value if nil or false

local function foo(x, y, z)
    local x = x or true
    local y = y or 1234
    z = z or "default"
end
Posted by: Guest on February-28-2022

Browse Popular Code Answers by Language