Question about periods in function names

Quick question.
A lot of times in module scripts I see stuff like this:

local function module.log()
--stuff
end

My question is whats the point of the period in module.log.

When you do

-- You don't use local here.
function module.log()

end

This is actually syntactic sugar (a nicer way to write something) for

module.log = function()

end

It’s just a neat syntax feature of Lua that makes our lives easier.

1 Like