For this project, I am using the Jest testing framework to test the functions.
So, you need to install it using either yarn or npm.
Run one of the following commands in your project's root directory:
yarn
-or-
npm i
First, follow the Install & Setup
section. Once setup, it is time to start.
Each function is set and named, but all functions are empty functions. Some of them will take params, return values,
and may have layers. These empty functions are just placeholers. Don't be afraid to change them. The names, however,
are required as those are the functions the test file is trying to import to test your code.
Each function has a comment above it with a description of the problem. If you don't understand what the question is
asking, it might help to look at what the test is doing. (I don't recommend this if you don't already know testing
frameworks in javascript!)
I recommend that you start by implementing the identity
function, as it is the easiest and will be an easy way to
test your environment is setup correctly.
As a final note, this may seem trivial at first, but it will quickly ramp up and test your knowledge of JavaScript and
some of the key concepts of the language
Good luck! :)
At the point that you are ready to test, it is as simple as running:
yarn test
-or-
npm test
This will start the Jest test runner and watch for changes to your code, triggering
a retest if it detects any changes.
If you want to submit your answers so others can view how you solved the problems, please follow these steps.
First, fork the repo. Next, you will want to create a folder in your forked repo follow this pattern:
rootDir/answers/<github-username>/
When you have completed the challenge, move your index.js
into the folder you created.
Now, create a new pull request to the answers
branch, of the main repo, from your fork.
Thanks to Douglas Crockford for the great class in functional JavaScript