Sum Difference
Given an array of integers, write a program to find the difference between the sumall the even numbersin the array and sum ofall odd numbersin the array. You can subtract the sums in whatever order you wish but the function must always return apositiveinteger. Please complete a function calledSumDiff, which takes an argument of an array of numbers and returns an integer.
function SumDiff(numbers) {// your code here// returns an integer}Example test case:Input: [1,5,8,2,10,33,36]Output: 17Reasoning: (8 + 2 + 10 + 36) - (1 + 5 + 33) = 17
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here