For the complete documentation index, see llms.txt. This page is also available as Markdown.

sum

⚠️ This is not a builtin function.

sum() is an array method, not a standalone function. See Array aggregating methods.

Usage

[10, 10, 5, 3, 5].sum()
// 33

[2, 5].sum()
// 7

Call .sum() on an array to find the total value of all the numbers in that array.

Last updated