Anyone know the difference?

Does anyone know the difference between the two elements in the image below?

image

Are they functionally the same? Or are they different?

["X"] = 5 uses a string key, while Y = 4 uses an implicit string key
both are equivalent ways to set string keys in a table, samething

1 Like

As long as Y isn’t a variable that holds something else (e.g. number, instance), they are the same.

1 Like

The only difference I can think of is what @ProgrammerOnCoffee mentioned and also the fact that using ["key here"] allows you to use spaces within the string key, while the other method doesn’t.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.