Skip to main content
Module

x/statistics/mod.ts>product

Deno basic statistics module.
Latest
function product
import { product } from "https://deno.land/x/statistics@v0.1.1/mod.ts";

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

This runs on O(n), linear time in respect to the array

Examples

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

Parameters

x: number[]

input

Returns

number

product of all input numbers