sum

Description

Sums all the numbers in a list.

Input / Parameter

NameDescriptionInput TypeDefaultOptionsRequired

data

The list of numbers to sum.

List

-

-

Yes

Output

DescriptionOutput Type

Returns the total value of the numbers in the list.

Number

Example

In this example, we will get the sum of numbers in a list and print the result in the console.

Step

  1. Call the function List.sum inside the Log.write function.

  2. Then call the function Conversion.toList inside the List.sum function.

    1. Enter the data inside the Conversion.toList function. In this example, we will enter "3, 1, 5".

Result

  1. The console will print the sum of all the values in the list.

  2. In this example, the value printed will be 9.

See also:

Last updated