Basic JavaScript Practice v2

In this practice, you will be taking some of the exercises you performed in Part 1 using the browser's console, and rewriting them into JavaScript files.

The problems will be reiterated again, and your job is to write the solution for each problem within the provided function declarations.

Download the starter here.

DO NOT copy and paste your old answers. Use this opportunity to apply what you have learned to practice re-solving problems. If you get stuck, avoid the temptation to look at your old code. Referencing things you wrote before is a great trick as a developer, but you'll do better here and at the start of the program if you use this as an opportunity to practice.

Tests have been written for you already to test if your answers behave as intended. To run the tests, simply run:

npm install

Followed by:

npm run test

If your tests aren't running, make sure Mocha is installed globally.