Functions let you group reusable code and run it whenever you want.
function greet()
board:("Hello, world!")
end
This defines a function named greet
that prints "Hello, world!".
greet
To run the function, just write its name.
function greet.name(name)
board:(name)
end
greet.name:("Bernardo")
This function prints the name passed to it.
end
. Function calls don’t need parentheses unless passing parameters.