Konnektr Logo

sum

Calculates the sum of an array of numbers.

sum

Calculates the sum of an array of numbers.

Type: transform

Parameters

  • input (array): The input array of numbers or individual number arguments.

Returns

Type: number

The sum of all numbers, or NaN if input is not an array.

Examples

sum([1, 2, 3, 4]) // 10
[1.5, 2.5, 3.0]|sum // 7
sum(1, 2, 3, 4) // 10

On this page