subtract.js 511 B

1234567891011121314151617181920212223
  1. var createMathOperation = require('./_createMathOperation');
  2. /**
  3. * Subtract two numbers.
  4. *
  5. * @static
  6. * @memberOf _
  7. * @since 4.0.0
  8. * @category Math
  9. * @param {number} minuend The first number in a subtraction.
  10. * @param {number} subtrahend The second number in a subtraction.
  11. * @returns {number} Returns the difference.
  12. * @example
  13. *
  14. * _.subtract(6, 4);
  15. * // => 2
  16. */
  17. var subtract = createMathOperation(function(minuend, subtrahend) {
  18. return minuend - subtrahend;
  19. }, 0);
  20. module.exports = subtract;