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.
Parameters
Section titled “Parameters”number[]
input
Returns
Section titled “Returns”number
product of all input numbers
Example
Section titled “Example”product([1, 2, 3, 4]); // => 24