Skip to main content
The Deno 2 Release Candidate is here
Learn more
method MathUtil.prototype.arrayCumsum
import { MathUtil } from "https://deno.land/x/sptaki@1.2.0/utils/MathUtil.d.ts";

Helper to create the cumulative sum of all array elements arrayCumsum([1, 2, 3, 4]) = [1, 3, 6, 10]

Parameters

values: number[]

The array with numbers of which to calculate the cumulative sum

Returns

number[]

cumsum(values)