Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What's the difference between table = {key = value} and table = {["key"] = value}?

I've seen the following:

table = {
	key = value
}
table = {
	["key"] = value
}

What are the differences?

1 answer

✓ Accepted answer

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.

1 comment

1

Syntax sugar is just an alternative way for you to type the same code. It will otherwise function in exactly the same way.

This discussion is preserved as it was. New answers, comments, and votes are closed.