Sample Video Frame
25: Functions and Recursion
Consider this exercise a novelty that you shouldn't really use.
Recursion is very simple but many beginners get confused that it actually works. To them it seems odd that a function can call itself. There's nothing odd about it because you can usually combine features of a language, and calling a function is one of those features. Once you realize that this is possible you can create very complicated ways of looping that do not need
while-loop style of processing.
In this code I simply loop over a range of numbers using recursion, and then do a more complex version that uses a callback.
Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.