What does .new do in functions

what does .new do in functions like for example:

function blah.new()
end
1 Like

: and . are called method calls.
They are mainly used in modules.

The only difference is that : passes self as its first parameter.

3 Likes

function something.whatever() is just making a function (whatever) in a table (something). It doesn’t have anything to do with modules.

3 Likes

I personally use them in modules, however they don’t have to be used by one.