Skip to content

product

product(x): number

Defined in: src/product.js:12

The product of an array is the result of multiplying all numbers together, starting using one as the multiplicative identity.

This runs in O(n), linear time, with respect to the length of the array.

number[]

input

number

product of all input numbers

product([1, 2, 3, 4]); // => 24