Things We Can Do with Hashes

Practice calling some important methods on hashes.

Methods of the Hash class

The main purpose of a Hash object is to look a value up by a key. However, there are a few more things we can do with hashes. Below is a list of methods supported by the Hash class. Don’t be too concerned with memorizing all of them.

The merge method

We can merge two hashes by calling the merge method:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy