import { default } from "https://deno.land/x/simplestatistic@v7.7.1/src/product.js";
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.
Examples
product([1, 2, 3, 4]); // => 24
product([1, 2, 3, 4]); // => 24