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