diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/add.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/add.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/add.js b/tools/eslint/node_modules/lodash/add.js new file mode 100644 index 0000000000..d09785022c --- /dev/null +++ b/tools/eslint/node_modules/lodash/add.js @@ -0,0 +1,29 @@ +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +function add(augend, addend) { + var result; + if (augend === undefined && addend === undefined) { + return 0; + } + if (augend !== undefined) { + result = augend; + } + if (addend !== undefined) { + result = result === undefined ? addend : (result + addend); + } + return result; +} + +module.exports = add; |