Training tasks for Lodash Math. The exercise consist of a few simple tasks. You are supposed to implement method, having provided only the method name and purpose.
Tests contain some usage of lodash methods.
Make sure that datasets app/datasets.js for each method are correct.
Adds two numbers.
Computes number rounded up to precision.
Divide two numbers.
Computes number rounded down to precision.
Computes the maximum value of array. If array is empty or falsey, undefined is returned.
This method is like _.max except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: (value).
Computes the mean of the values in array.
This method is like _.mean except that it accepts iteratee which is invoked for each element in array to generate the value to be averaged. The iteratee is invoked with one argument: (value).
Computes the minimum value of array. If array is empty or falsey, undefined is returned.
This method is like _.min except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: (value).
Multiply two numbers.
Computes number rounded to precision.
Subtract two numbers.
Computes the sum of the values in array.
This method is like _.sum except that it accepts iteratee which is invoked for each element in array to generate the value to be summed. The iteratee is invoked with one argument: (value).
Read Lodash documentation at http://lodash.com/docs.
To install dependencies from package.json:
yarn install
To run tests in development mode:
mocha --watch
To run verify jshint and tests:
yarn test
To run verify jshint and tests with human readable output:
grunt --force