sum
Last updated
Last updated
Sums all the numbers in a list.
data
The list of numbers to sum.
List
-
-
Yes
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