Skip to main content
variable accumulate
import { accumulate } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Returns an array of partial sums. Use Array.prototype.reduce(), Array.prototype.slice(-1) and the unary + operator to add each value to the unary array containing the previous sum.

type

(...nums: number[]) => number[]