I'm new at javascript and am trying to finish up a test. So far I've done ok, but I can't seem to get right the three last things: - it should return the sum with one number array - it should return zero if all elements are zero - it should return the sum when passed array of numbers
const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10]; function sumNumbers(arr){ if (arr === undefined || arr.length == 0) { return 0; } array.reduce(function(a, b){ return a + b; }, 0); }