Skip to Content
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.

Folder Icon

Take this course for free

Already have an account?