The problem:
Write a function called mostFrequentWords which get the ten most frequent word from a string?
const paragraph = `I love teaching. If you do not love teaching what else can you love. I love Python if you do not love something which can give you all the capabilities to develop an application what else can you love.`
console.log(mostFrequentWords(paragraph, 3))
and the res should be:
[
{word:'love', count:6},
{word:'you', count:5},
{word:'can', count:3},
]
Top comments (1)
So that's it.