Remember that you won't be return
-ing in this set of functions, just mutating the original array. Check main.test.js
to see how we're using your function--we just pass in an array and then check if that array now contains the set of values we expected.
This is a typical test-based assignment, so:
- Fork and clone
npm install
npm run test
addMeToEnd
- adds the string 'Anthony' to the end of the given array.addMeToStart
- adds the string 'Anthony' to the start of the given array.changeLast
- changes (not adds!) the last value in the given array to the value given.changeAllValuesTo
- changes every value in the given array to the given value.oddOrEven
- changes every numerical value in the given array (you can assume they'll all be numbers) to the string 'odd' if the number is odd and 'even' if it's even.changeNextThreeToValue
- starting with the given index, changes three consecutive values in the given array to the given value. Note the order of our 3 parameters, and check the tests if you're unsure.