Skip to content

Instantly share code, notes, and snippets.

@jwulf
Created March 6, 2018 22:22
Show Gist options
  • Select an option

  • Save jwulf/d5a1f865b5dd678ec0d197a7e221dd9e to your computer and use it in GitHub Desktop.

Select an option

Save jwulf/d5a1f865b5dd678ec0d197a7e221dd9e to your computer and use it in GitHub Desktop.
Lodash add.js in ES6
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