- Install dependencies with
yarn - Run
yarn testto check that jest runs the tests but they fail for sensible reasons - Consult the tests and edit myFunctions.js
- implement the functions in myFunctions.js until all tests pass.
Weirdly, your code should not contain any loop structures (no for or while loops).
Unlike in some earlier katas, for this set of exercises you should try to make use of some of the built-in js array methods instead.
Specifically, you should research the following, to see which ones can help you. (You won't need them all.)
- array.find
- array.findLast
- array.findIndex
- array.filter
- array.some
- array.includes
- array.indexOf
- array.every
- It's fine to make little helper functions to get the work done
- It's fine to use arrow functions or normal function declaration syntax wherever you like, except...
- Don't change the signature (first line) of the given functions, nor their jsdoc, only their bodies.
- (so, also don't change the form of the existing functions to be arrow functions.)
- It should not be necessary to edit the test file. (though you are welcome to add MORE tests to give further clarity or visibility into any problem)