Top 3 Words

This JavaScript function takes a string of text and returns an array of the top 3 most occurring words, in descending order of occurrences.

Summary

To use this function:

  1. Clone the repository to your local machine using
git clone https
  1. go to directory
cd 
  1. make sure you install npm and node js on your system link

  2. uncomment the function call in index.js and run the project by

npm start

or in watch mode

npm run watch

How to use

const topWords = top3Words("Your text goes here...");
console.log(topWords); // Output

Running Tests

To run tests, use the following command:

  • to install jest
npm install
  • to run test
npm test