Are there any differences between
local name = function()
and
local function name()
I can’t find any differences myself, but I haven’t tested speed or anything like that. Is there one that is better to use or are they essentially the same?
Are there any differences between
local name = function()
and
local function name()
I can’t find any differences myself, but I haven’t tested speed or anything like that. Is there one that is better to use or are they essentially the same?
Using function name()
will let you call it recursively where you can’t do that with an anonymous function (local var =)
As for memory consumption and garbage collection, I’m not sure on that.
The difference is negligible and probably comes down to your use and minute memory differences.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.