Higher order functions can be a bit confusing when you first start working with them, but I found that just trying to create a few of them myself helped immensely in my understanding of what they are and how they work.
So I thought I would create a micromaterial to help other people practice just filling in the missing parts of higher order functions.
There are 10 higher order functions that are incomplete. Try to complete them and then run the tests to see how you did.
You can either run the tests manually when you want to check, via npm test
, or run them in watch mode to run each time you save via npm run test:watch
.
if you have no idea where to start, take a look at the tests in
index.spec.js
Just click the button below!
Open your text editor or IDE (like VS Code), and try to complete the functions. Run the tests as explained above (either in the IDE terminal or in a separate terminal window) to check your work.
if you need a hint, just check the git log to see what the functions were originally.