Hello, I need a minute of Lua help. What is the syntax for optional parameters or default values. I want something equivalent to this:
function(--[[required]]var1, --[[optional]]var2, --[[optional]]var3)
if not var2 then
var2 = 6--default value
end
if not var3 then
var3 = 0 --default value
end
--Do something with the inputs
end
Is there anything more succinct than what I have there? Optional arguments or multiple function definitions seem to be a built-in feature with most of the languages I have worked with in the past, but I canât seem to find an equivalent for Lua. Maybe I am just looking in the wrong places! Thanks!