Lua - how to create functions

I have a question about declaring functions in lua.

I got the impression that public functions are declared as:

abc = function() end 

Local / private functions:

 local abc = function end 

But I'm not sure what this notation is:

 function abc() end 
+4
source share
1 answer

As seen in 2.5.9 of the reference guide

Statement

  function f () body end 

translates to

  f = function () body end 
+2
source

Source: https://habr.com/ru/post/1492376/


All Articles