Hi all!
Just a super quick question about variable scope.
Lua Code:
local testVar = 1;
function testFunc()
local testVar = testVar;
print(testVar);
testVar = 2;
end
testFunc();
print(testVar);
For the code snippet above, it would print 1 for both testVar.
The question is, can you change the value of outer variable even if you declare a new local variable with an outer one's name within a function? or should I prevent such circumstances if I'd like to do so?