Skip to content

sum

The sum function takes a list of numbers and returns the sum of those numbers.

basic usage

arguments

  • arr: number[] - The list of numbers to sum.

returns

  • number The sum of the numbers in the list.
ts
import { sum } from 'func-dash'
sum([1, 2, 3]) // 6
sum([1, 2, 3, 4, 5]) // 15