Top index Wirbel home

::sum

sum(list(A) alist) - return sum of elements in a list

sum(list(A) alist) computes the sum of all elements in alist by adding the elements with the binary operator +. If the list is empty then the datatypes neutral element is returned. sum(list(A) alist) works on all datatypes supporting +.

Examples

sum([1,2,3]) == 6
sum([1,2,3].cleared()) == 0
sum(["Hello", " ", "World"]) == "Hello World"

See also

cleared