Hash is a collection of unique keys and values in Ruby. Hash is similar to an Array, except that it indexes with arbitrary keys of any object type. The order in which various iterators return keys and their values in Hash is random and will rarely be in the insertion order.
In Ruby, you can make a Hash by using the => operator to assign a key to a value, separating the key/value pairs with commas, and enclosing everything with curly brackets.`
Share a personalized message with your friends.