main
|
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 20 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
478 bytes
|
| Rev | Line | |
|---|
| [d24f17c] | 1 | var add =
|
|---|
| 2 | /*#__PURE__*/
|
|---|
| 3 | require("./add.js");
|
|---|
| 4 |
|
|---|
| 5 | var reduce =
|
|---|
| 6 | /*#__PURE__*/
|
|---|
| 7 | require("./reduce.js");
|
|---|
| 8 | /**
|
|---|
| 9 | * Adds together all the elements of a list.
|
|---|
| 10 | *
|
|---|
| 11 | * @func
|
|---|
| 12 | * @memberOf R
|
|---|
| 13 | * @since v0.1.0
|
|---|
| 14 | * @category Math
|
|---|
| 15 | * @sig [Number] -> Number
|
|---|
| 16 | * @param {Array} list An array of numbers
|
|---|
| 17 | * @return {Number} The sum of all the numbers in the list.
|
|---|
| 18 | * @see R.reduce
|
|---|
| 19 | * @example
|
|---|
| 20 | *
|
|---|
| 21 | * R.sum([2,4,6,8,100,1]); //=> 121
|
|---|
| 22 | */
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | var sum =
|
|---|
| 26 | /*#__PURE__*/
|
|---|
| 27 | reduce(add, 0);
|
|---|
| 28 | module.exports = sum; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.