Code Editor
Data Structures


What we just showed you was hash literal notation. We call it that because you literally describe what you want in the hash: you give it a name and you set it equal to one or more key => value pairs inside curly braces.

You can also create a hash using, like so:

my_hash =

Setting a variable equal to creates a new, empty hash; it's the same as setting the variable equal to empty curly braces ({}).

Report a Bug
If you see a bug or any other issue with this page, please report it here.