test-action-debian-package/node_modules/ramda/src/sum.js

28 lines
472 B
JavaScript
Raw Normal View History

2020-03-26 14:37:35 +00:00
var add =
/*#__PURE__*/
require("./add");
var reduce =
/*#__PURE__*/
require("./reduce");
/**
* Adds together all the elements of a list.
*
* @func
* @memberOf R
* @since v0.1.0
* @category Math
* @sig [Number] -> Number
* @param {Array} list An array of numbers
* @return {Number} The sum of all the numbers in the list.
* @see R.reduce
* @example
*
* R.sum([2,4,6,8,100,1]); //=> 121
*/
var sum =
/*#__PURE__*/
reduce(add, 0);
module.exports = sum;