Skip to main content
Module

x/statistics/mod.ts>sumSimple

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

The simple sum of an array is the result of adding all numbers together, starting from zero.

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

Examples

sumSimple([1, 2, 3]); // => 6

Parameters

x: number[]

input

Returns

number

sum of all input numbers