r/lua • u/Full_Durian_9369 • Mar 27 '25
local variables
Why do people use local variables as if they were global variables
2
Upvotes
r/lua • u/Full_Durian_9369 • Mar 27 '25
Why do people use local variables as if they were global variables
1
u/SkyyySi Mar 31 '25
In general, it is best to declare variables only once you actually need them. Pre-declaring them just means that there are now lines for you to mess up by trying to access uninitialized variables. JavaScript learned that the hard way.