sum
Last updated
Last updated
Sums all the numbers in a list.
Name | Description | Input Type | Default | Options | Required |
---|---|---|---|---|---|
data | The list of numbers to sum. | List | - | - | Yes |
Description | Output Type |
---|---|
Returns the total value of the numbers in the list. | Number |
In this example, we will get the sum of numbers in a list and print the result in the console.
Call the function List.sum
inside the Log.write
function.
Then call the function Conversion.toList
inside the List.sum
function.
Enter the data inside the Conversion.toList
function. In this example, we will enter "3, 1, 5".
The console will print the sum of all the values in the list.
In this example, the value printed will be 9
.
See also:
Functions