re: Recursion recall, because it's necessary VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Thank you for pointing that out. Going back to the find all even number example say I'll write a fucntion find all odd number *NOTE: code example u...
 

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.

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

code of conduct - report abuse