Hashes • Exercise 2/4

Get Hash Value

00:00
0
15 points

Instructions

Create a function get_value that takes a hash, a key, and a default value.
Return the value for the key if it exists, otherwise return the default.

Use Ruby's fetch method with a default value.

Your Code

Results

Click "Run Tests" to see results