We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

elacodes • 1 year ago

What do you think of this as an alternative to question 7?


function totalIntegers(arr) {
let total = 0;
arr.forEach(item => {
if (Array.isArray(item)) {
total += totalIntegers(item)
} else if (typeof item === 'number') {
total++
}
})

return total
}

mELtingaWay __ • 2 years ago

For Question #8 you don't need the base case if (arr.length === 0) return 0.

marshistah • 4 years ago

this is the best recursive tutorial i have ever seen