Originally Posted by Stormknight
...
Something that often confuses new LUA coders - table entries start with an key/index of 1.
...
|
If you are learning Lua with knowledge of any other programming language, you may want to read this:
http://www.luafaq.org/gotchas.html.
Warning: Spoiler
Off topic - I'm fan of shortcuts, so instead of this:
Originally Posted by lyravega
Lua Code:
if not newTable.testValue then newTable.testValue = "NOPE" --will not do it, as testValue is present
|
I'd use this:
Lua Code:
newTable.testValue = newTable.testValue or "NOPE"