Hey guys,
I’m doing alot of reading about lua and corona tutorials. One thing I see very often is developers not localizing their code to the files. Here’s a few things I’ve seen…
require("someModule")-- this is how I've learned itlocal someModule = require("someModule")
Another thing I’ve seen and not really seen any explanation to is…
someLuaFile.lua
return { someVar = 1234, anotherVar = "varName" }
While I know that does the same thing as…
someLuaFile.lua
local t = { someVar = 1234, anotherVar = "varName"}return t
I know the purpose of this but what benefits do I get from either one, what is best and when should I use one over the other?
Thanks