Skip to main content
Module

x/simplestatistics/src/sum_simple.js>default

simple statistics for node & browser javascript
Latest
function default
import { default } from "https://deno.land/x/simplestatistics@v7.8.3/src/sum_simple.js";

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

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

Examples

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

Parameters

x

input