Created
March 6, 2018 22:22
-
-
Save jwulf/d5a1f865b5dd678ec0d197a7e221dd9e to your computer and use it in GitHub Desktop.
Lodash add.js in ES6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import createMathOperation from './.internal/createMathOperation.js' | |
| /** | |
| * Adds two numbers. | |
| * | |
| * @since 3.4.0 | |
| * @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 | |
| */ | |
| const add = createMathOperation((augend, addend) => augend + addend, 0) | |
| export default add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment