To test your function, call calcWordFrequencies() from the JavaScript console in the browser.