Skip to main content

Add

Module Info:

moduleType: "internal",
moduleName: "add"

Description

The add function takes a list of numbers and return their sum.

Inputs

NameTypeRequired
numbersToAddArray<number>

Outputs

NameType
resultnumber
errorMessagestring

The errorMessage property will only be defined if any of the items in the input list are not numbers.

Examples

Inputs Outputs
numbersToAdd result errorMessage
[ 4, 3, 2 ] 9 undefined
[ 1, 9 ] 10 undefined
["foo", 5] undefined "One of the arguments provided was not a number"