<PLEASE USE HI,
I would really appreciate some help to understand the code- not just write it properly.
frequencies = Hash.new(0)
words.each do |word| frequencies[word] += 1
I am confused about using “word” twice in the code. the |word] declares the name/ is a placeholder for the iterating through “words” then the frequencies[word] is declaring the the key in the frequencies hash to be “word” and the value will incremement by 1
but why is word used twice and how do they relate to one another?