Instead of having to define every parameter every time, is there a way to select a default?
I know in some languages it's possible to do something like this:
function myNewFunc(defaultVar = true)
--do code
end
So that if defaultVar doesn't get a value passed in it'll be true.
I'd like a simpler way than this:
function myNewFunc(defaultVar)
if defaultVar == nil then
defaultVar = true;
end
--do code
end
Any insights?

2 comments
I wish Lua had the same syntax as Python when it comes to declaring parameters, so you can just have the statement within the parenthesis :p
for default values