If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Write your code in the body of the sumOfAMultiple function in your multiples.js
file so that the tests pass. The function will return the sum of all the multiples of 3 or 5 below n.
There are 4 tests in multiples-spec.js
, once your first two tests pass, uncomment the last two and fill in the correct result.
- Clone this repository
- Run the command:
npm install
- Open this repository in your text editor of your choice.
- Your work will be done in the file named:
multiples.js
- There are tests in place to check your work. To run these tests, run the command:
npm test
- Once you have two tests passing, open the test spec file
multiples_spec.js
and un-comment the last two tests. - These last two tests were written incorrectly, fix them!