Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/itertools/builtins.ts>sum

🦕 A TypeScript port of Python's itertools and more-itertools for Deno
Go to Latest
function sum
import { sum } from "https://deno.land/x/itertools@v1.1.1/builtins.ts";

Sums the items of an iterable from left to right and returns the total. The sum will defaults to 0 if the iterable is empty.

Parameters

iterable: Iterable<number>

Returns

number