← Back to challenges

Sum Greater Than Five

JavaScriptHardarraysmathlanguage_fundamentals

Instructions

Write a function that returns the sum of elements greater than 5, in the given array .

Examples

sumFive([1, 5, 20, 30, 4, 9, 18]) ➞ 77

sumFive([1, 2, 3, 4]) ➞ 0

sumFive([10, 12, 28, 47, 55, 100]) ➞ 252

Notes

Find all the elements greater than 5, not the elements greater than or equal to 5.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Filter Strings from Array