add.js 358 B

12345678910111213141516171819
  1. /**
  2. * Adds two numbers.
  3. *
  4. * @static
  5. * @memberOf _
  6. * @category Math
  7. * @param {number} augend The first number to add.
  8. * @param {number} addend The second number to add.
  9. * @returns {number} Returns the sum.
  10. * @example
  11. *
  12. * _.add(6, 4);
  13. * // => 10
  14. */
  15. function add(augend, addend) {
  16. return (+augend || 0) + (+addend || 0);
  17. }
  18. module.exports = add;