Functions and operators exercises. To run
- Fork repo
- Clone forked repo to local machine
- Solve the exercises one at a time and do a git commit and push after each one
- Aim to use the right array method where possible instead of for/while loops
- Submit a
Pull Request
after first push this will run tests on the server and let you know if the tests are passing.
Exercises can be debugged in browser by opening index.html
.
To run tests locally, make sure you have node
and npm
installed. You can install it from https://nodejs.org/en/
- Run
npm install
- you only need to run this once after cloning to fetch the external libraries used for testing - Run
npm test
- this will run the actual tests
The tests are located in test/index.test.js
. To run a test for only single function, you can change the test function name from test
to test.only
. This will limit the amount of output you receive from each test run and make it easier to focus on the function you are working on.
for example change
test('Add', () => {
const result = add( 2, 3 );
expect( result ).toEqual( 5 );
});
to
test.only('Add', () => {
const result = add( 2, 3 );
expect( result ).toEqual( 5 );
});