I've seen the following:
table = {
key = value
}
table = {
["key"] = value
}
What are the differences?
I've seen the following:
table = {
key = value
}
table = {
["key"] = value
}
What are the differences?
Absolutely nothing. It’s called syntactic sugar and is meant to make the syntax of a language more clean. The latter example is used when the key has white space, numerical operators, or begins with a number.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Syntax sugar is just an alternative way for you to type the same code. It will otherwise function in exactly the same way.