UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

13 lines 321 B
export const product = { label: 'product', fn: function arrayProduct() { const ctx = this; const len = ctx.length; if (!len) return 0; if (1 === len) return ctx[0]; return ctx.reduce((p, n) => p * n, 1); }, }; //# sourceMappingURL=product.js.map