title: JavaScript: Using an object to iterate over array and keep track of item frequency
body: <p>I need a function <code>mostFrequentWord</code> to return the most common string found in an array <code>words</code>. I would like to use an object to keep track of these word frequencies. Using getter and setter methods seem like the most viable option. Where the setter function is used to change the value for each key representing the word. Then after I sort the object by frequency value I can return the word with the highest frequency. Am I over thinking this problem?</p>