add

array

Sums all numeric elements in an array

Syntax

add(array)

Parameters

array (array)

The array of numbers to sum

Returns

number

The sum of all numeric elements

Examples

Input:
[1, 2, 3, 4] | add
Output:
10
Input:
[5, 10, 15] | add
Output:
30

The add() function calculates the sum of all numeric elements in an array. It processes each element and returns the total.

Usage

This function is useful for calculating totals, aggregating values, and performing arithmetic operations on collections of numbers.

Related Functions