Calculate the sum of positive numbers in an Array
Given an array of numbers, return the summation of all positive numbers in the array.
Sample Code:
function sumPos(arr) {
// Enter your logic here...
}
Examples:
Input: [1,2,3,-999]
Output: 6
Explanation: The positive numbers are 1,2,3.
Input: [1,-2,-3,-999]
Output: 1
Explanation: The only positive number is 1.