In the “Counter Hashes” section, there is an example about using hash with a default value.
with a default value
default_cuties = Hash.new(“cutie”)
dog_breeds[“vizsla”] #=> “cutie” <----- I think it should be default_cuties[“vizsla”]
accessing a nonexistent key doesn’t alter the hash
dog_breeds #=> {} <----- I think it should be default_cuties because dog_breeds is not an empty hash
I hope it helps.