Iterating Over the Array


It's working. Just not passing? "Oops, try again. It looks like you haven't set the frequencies hash correctly. Check the Hint if you need help!"

puts "I WANT TEXT"
frequencies =
puts frequencies[words]


Well.. What do you mean by working? Maybe it should do something else?

It seems to me like the intention is to count how many times each word appears, is your code doing that for text that you enter? If you enter hello hello hello will it have counter hello 3 times?


I'm not exactly sure, here are the instructions:
1. Use .each to iterate over the words array.
2. For each word we find, assume that the word itself is a key in frequencies and increment its value by 1.
3. This is why our default is 0. The first time we find the word, it will have a default value of 0 that we can increment up to1


Then you would need to read the instructions! Get an idea for what is asked for. If there's some particular piece of information or part of the instructions that eludes you, then you'll have to ask about that. I also wrote out what I think the instructions are asking you to do but I can't tell if you read that or not. Read the instructions and compare your understanding of them to what I wrote.