- Learn about hashes in Ruby.
Research and then write answers to the following questions in lib/hashes.md.
- What is a Hash?
- What are some examples of information that would be Hashes as opposed to some other data type?
- How are Hashes and Arrays similar? How are they different?
- How do you retrieve a particular value from a Hash?
- How do you add information to a Hash?
- How would you perform an operation on every element inside a Hash?
- How would you change the value of a particular element in a Hash?
- How do you delete an element from a Hash?
- What happens if you try to retrieve an element from a Hash that does not exist in the Hash?
- How do you determine how many elements are in a Hash?
Remember two things:
- You don't need to submit any code to us for this assignment. Just provide in-your-own-words answers for the questions above.
- We're not looking for any kind of advanced writing skills nor any kind of length. Just be clear and thoughtful about what you write--organize it however it makes sense for you.
As always, one resource is Google. Some of the questions above can by entered verbatim into a Google search, and for others that won't be as effective. Either way, expect to read (or watch videos) about more than just the simple answer to each question. Often a question's answer--even one that seems short or simple--doesn't really make sense until after you've read the paragraphs before and after it.
- https://rubymonk.com/learning/books/1-ruby-primer/chapters/10-hashes-in-ruby/lessons/46-introduction-to-ruby-hashes
- https://rubymonk.com/learning/books/1-ruby-primer/chapters/10-hashes-in-ruby/lessons/47-hashes-in-and-out
- https://github.com/learn-co-curriculum/hash-overview-readme
- http://ruby-doc.org/core-2.1.3/Hash.html