Skip to content

product

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

Find the product of numbers (∏).

Similar: sum, product.


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

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


xmath.product(1, 2);
// → 2

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

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