Most used word in a string
Given the provided block of text, from Alice in Wonderland (string) write a function that accepts the text
(string).
The function should return an array of objects with the top 3 most used words and the
counts.
Display the top 3 words and their
counts.
Consider only letters and numbers and filter out any special characters.
Example:
Input: "Hello GoodBye Hello Hello Seeya GoodBye Hello GoodBye Seeya`"
Returns: [
{word: 'hello', count: 4},
{word: 'goodbye', count: 3},
{word: 'seeya', count: 2}
]
Extra Credit: Filter out stop words using the stop list provided. Stop words are words that do not provide any useful information to infer content or nature.