Skip to content

Instantly share code, notes, and snippets.

@amejiarosario
Created January 10, 2020 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amejiarosario/118df9c8f3d3f9746d3467c2f2718c9e to your computer and use it in GitHub Desktop.
Save amejiarosario/118df9c8f3d3f9746d3467c2f2718c9e to your computer and use it in GitHub Desktop.
const dictionary = {the: 22038615, be: 12545825, and: 10741073, of: 10343885, a: 10144200, in: 6996437, to: 6332195 /* ... */};
function getWordFrequency(dictionary, word) {
return dictionary[word];
}
console.log(getWordFrequency(dictionary, 'the'));
console.log(getWordFrequency(dictionary, 'in'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment