Skip to content
Subhajit Sahu edited this page Aug 8, 2022 · 16 revisions

Find the sum of numbers (Σ).

Similar: sum, product.


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

const xmath = require('extra-math');


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

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

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