Learn

The hash syntax you’ve seen so far (with the => symbol between keys and values) is sometimes nicknamed the hash rocket style.

numbers = { :one => 1, :two => "two", :three => 3, }

This is because the => looks like a tiny rocket!

Let’s build a hash from the ground up using symbols as keys.

Instructions

1.

Create a hash called movies with symbols as keys and strings as values.

Inside your hash, add two key/value pairs.

The keys should be the names of movies.

The values should be quick descriptions or reviews.

Check out the Hint if you want an example to get you started!

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Already have an account?