Sum

From MiniScript Wiki
Jump to navigation Jump to search

sum returns the total of all elements in a list, or all values in a map.

Arguments

Parameter Name Default Value Meaning
self list or map object to sum

Example

range(3).sum	// returns 6 (3 + 2 + 1 + 0)