JSchallenger

Sum up all array elements with values greater than

Viewed: 389
Attempted: 76
Solved: 18
// Write a function that takes an array and a number, say num, as arguments
// Sum up all array elements with a value greater than num
// Return the sum

function myFunction() {

return
}
Test Cases:
myFunction([1, 2, 3, 4, 5, 6, 7], 2)
Expected
25
myFunction([-10, -11, -3, 1, -4], -3)
Expected
1
myFunction([78, 99, 100, 101, 401], 99)
Expected
602