101 posts
Location
Norway
Posted 17 January 2014 - 02:17 PM
Hello :D/>
i'm just wondering… what's the difference between
function a(param1, param2)
and
a = function(param1,param2)
???
175 posts
Posted 17 January 2014 - 02:21 PM
Nothing.
91 posts
Posted 17 January 2014 - 02:26 PM
function a() is syntactic sugar for a = function(). The only time it actually matters which method you use is when you put functions inside a table
local table = { a = function(var) print(var) end,}
table.a("Hello World") --> Hello World
101 posts
Location
Norway
Posted 17 January 2014 - 02:40 PM
.
Edited on 17 January 2014 - 01:40 PM
7083 posts
Location
Tasmania (AU)
Posted 17 January 2014 - 08:09 PM
This post expands further on the subject.
7508 posts
Location
Australia
Posted 17 January 2014 - 08:17 PM
To expand on the link to my explanation that Bomb Bloke posted, the main section you should read is the spoilers.
Now the spoilers directly deal with localised functions, due to the fact that it is where the way you define begins to differ, but it will definitely help you understand better :)/>