DEV Community

Discussion on: Recursion recall, because it's necessary

Collapse
 
curtisfenner profile image
Curtis Fenner

What was missing was what you are recursing on, which is the tail of the input list. With the example code the recursion makes sense.

However, the "base case" isn't what you said -- the base case is the if (are.length == 0) {, which doesn't have anything to do with whether numbers are odd or even. This is what three me off.

Thread Thread
 
jonathanmkpt profile image
Jonathan Thomas

Thanks for that I'll be more careful in the future