Tables in general
In tables in general, the square brackets [] are used to index a table, it can be used to get and set the value attached to that index of the table
In dictionaries, square brackets are primarily used as an alternative for . when the key string contains a whitespace, such as "Hello World", or "Grape Juice".
For example:
local tbl = {}
tbl["Hello World"] = "hello there"
print(tbl["Hello World"])
Roblox Objects
On the topic of roblox objects, I believe i explained it in enough detail in my answer on this question, so you should check that out for a more in depth explanation than i will be giving here.
But , in essense the square brackets , when used on objects such as a baseplate, workspace, etc. essentially get one of the properties / children / methods of said object's metatable.
You may be confused on what I mean "the object's metatable" Well, as roblox objects are all userdata values, they are attached to a metatable containing all the children, methods, and properties.
If any of that sound familar, it is because the newproxy function, when given a true parameter, returns a userdata attached to an empty metatable. newproxy is also handy for things like metatable wrapping
Hopefully this helped!
3 comments
It's a dictionary index (10/10 comment)
Lets say a part in workspace. The name has a space or symbol instead of putting workspace.Part Test you put workspace[“Part Test”]
I recommend starting with this link (https://developer.roblox.com/articles/Table) and learn all you can about tables and then move on to discover something else.