Course Content

Course Content

FAQs

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.

Curly braces are used instead of square brackets in hash literals, and the key value pairs are joined by =>. A hash with a single key/value pair of Bob/84, for example, might look like this: "Bob" equals 84. By separating key/value pairs with commas, further key/value pairs can be added to the hash literal.

You may build an array of hashes by either using array or simply initializing array with hashes. To push hashes inside the array, use push(). In ruby, both "Key" and:Key function as a key in a hash.

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere