New hash, why does it need a default value?


Hello everyone,

I'm trying to figure out why the lesson requires you to create a new hash "with a default value of 0"

frequencies =
why can't it just be
frequencies =
Whats the difference between the two and how is it gonna be useful later?

Thanks everyone for your help
Have a great day !


My bad, they explained it in the next lesson;

Then what it means is that the default value does NOT get printed until it gets a key, am I right?

Thanks again and have a great day