2 ms·
you made the same mistake I did at first. Corrected below. function arraySum(i) { var total = 0 for(var x=0; x < i.length; x++) { if(typeof i[x] == 'objec
by ep103 13y ago
you made the same mistake I did at first. Corrected below.
function arraySum(i) {
var total = 0
for(var x=0; x < i.length; x++) {
if(typeof i[x] == 'object') {
total += arraySum(i[x])
} else if(typeof i[x] == 'number') {
total += i[x]
}
}
return total
}