Code Editor
Learn
Hashes and Symbols

A Key of a Different Color

We can certainly use strings as Ruby hash keys; as we've seen, there's always more than one way to do something in Ruby. However, the Rubyist's approach would be to use symbols.

Instructions

Check out the code in the editor. Those funny-looking variables that start with colons are symbols. Click Next to the next section for a symbol rundown.

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