✓ Accepted answer
function func(...)
end
is syntax sugar (a nicer way of writing something else) for this:
func = function(...)
end
The syntax sugar for a local function is this:
local func
func = function(...)
end
And not this:
local func = function(...)
end
That is because this example will not make func an upvalue (external local variable) inside the function's body, and because of that you won't be able to make recursive function calls.
But to answer your question, it really doesn't matter which you use. local function func(...) end is the same as local func; func = function(...) end and function func(...) end is the same as func = function(...) end.
3 comments
They're both the same, I can't exactly explain when to use them differently, i would leave that to someone else, I'll just say local PrintSomething would be used in a moudle script, and lcoal function would restrict the use of the function to anything above
use either one, they are the same
A simple search would have sufficed. Here is a popular post just about it. https://scriptinghelpers.org/questions/59764/what-does-all-these-different-types-of-functions-do