Sum of negative number in an Array
Given an array consisting of both positive and negative numbers, return the sum of the negative numbers.
Sample Code:
function sumNeg(arr) {
// Enter your logic here...
}
Examples:
Input: [1,2,3,-4,-5,-6]
Output: -15
Explanation: -15 is the sum of all negative numbers in the array.
Input: [1,2,3,4,5,6]
Output: 0
Explanation: 0 represents zero negative number to be found.