Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 2 revisions

Find the sum of numbers (Σ).

Similar: sum, product.


function sum(...xs)
// xs: a list of numbers

const xnumber = require('extra-number');


xnumber.sum(1, 2);
// → 3

xnumber.sum(1, 2, 3);
// → 6

xnumber.sum(1, 2, 3, 4);
// → 10
Clone this wiki locally