Hash Quiz
animals = {
"first" => "kangaroo",
"second" => "koala",
"third" => "pterodactyl",
0 => "a number, not an animal"
}
Consider the above hash, animals. Invoking animals[0] returns what?
Consider the above hash, animals. Invoking animals[-1] returns what?
Invoking the #values method on a hash returns what type of object?
animals = {
first: "kangaroo",
second: "koala",
third: "pterodactyl"
}
Consider the above hash, animals. Invoking animals["first"] returns what?
hash = {one: :two}
hash[:two] = :three
hash[:one] = :four
puts hash[:one] # ????
puts hash[:two] # ????
Consider the above hash. What is hash[:one] ?
Consider the above hash. What is hash[:two] ?