The {} mean you “injecting” the value of a variable into some form of text.
So:
>> x = “Hi {name}!”
Means I’m injecting the value of name right into that text.
Similarly for:
>> x = {“dog”->”Dog”, “{myVariable}”->”Cat”}
I’m injecting myVariable
inside that key. Keys (in associations) are always text.
Also:
Hello {name}!
Is a case where a variable is being injected into text that’s simply getting shown to the screen.
On the other hand:
>> animals = [variable1, variable2]
Doesn’t need {} because you’re not injecting variables into text, you’re just using their values directly.