Search
So far, we have seen a hash being created like this:
There is another way to create a hash using new:
new
Hash.new creates an empty hash. To this empty hash, we need to add key and value, as shown below:
Hash.new