← Back to challenges

Get the Sum of All Array Elements

JavaScriptHardarrayslanguage_fundamentalsmathnumbers

Instructions

Create a function that takes an array and returns the sum of all numbers in the array.

Examples

getSumOfItems([2, 7, 4]) ➞ 13

getSumOfItems([45, 3, 0]) ➞ 48

getSumOfItems([-2, 84, 23]) ➞ 105

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is It a Triangle?