Recursion – Part 7 of Functional Programming in JavaScript

💖 Support the show by becoming a Patreon

In this video, we are going to learn about recursion – what recursion is, how it works, and why it’s useful.

This video is part of a series – you’ll get a lot more out of it if you watch the other episodes before watching this one. You can find them here:

Recursion is when a function calls itself until it doesn’t.

That is seriously all recursion is. It’s really simple.

A lot of people think that recursion is hard. The reason people think that recursion is hard is because all explanations of recursion use fibonacci numbers as an example, which is the worst example ever. If somebody tries to explain recursion to you using fibonnaci numbers, you must murder them. I understand that sounds rough, because they mean well, but we really need to get rid of that, because it makes everyone think that recursion is hard, when it is actually easy.

💛 Follow on Twitch
We record the show live Mondays 7 AM PT

💛 Fun Fun Forum
Private discussion forum with other viewers in between shows. Available to patron members, become one at

💛 mpj on Twitter

💛 CircleCI (Show sponsor)
Robust and sleek Docker-based Continuous Integration as a service. I used CircleCI prior to them becoming a sponsor and I love that their free tier is powerful enough for small personal projects, even if they are private. Use this link when you sign up to let them know you came from here:

💛 Quokka (Show sponsor)
Wonder how MPJ evaluates JavaScript inline his editor. Quokka is the answer – use this link when you buy to let them know you came from here:

Since 2015, Fun Fun Function (FFF) is one of the longest running weekly YouTube shows on programming 🏅 thanks to its consistency and quality reaching 200,000+ developers.

🤦‍♂️ The Failing Together concept is what makes FFF unique. Most coding content out there focus on step-by-step tutorials. We think tutorials are too far removed from what everyday development is like. Instead, FFF has created a completely new learning environment where we grow from failure, by solving problems while intensively interacting with a live audience.

Tutorials try to solve a problem. Failing Together makes you grow as a developer and coworker.

📹 Each show is recorded live on Twitch in a 2-hour livestream on Mondays. The host, assisted by the audience, is tasked to complete a programming challenge by an expert guest. Like in the real world, we often fail, and learn from it. This, of course, reflects what the audience identifies with, and is one of the most praised aspects of the show.

⏯ On Fridays, an edited version of the show is adapted for and published on YouTube.

Content Topics revolve around: JavaScript, Functional Programming, Software Architecture, Quality Processes, Developer Career and Health, Software Development, Project Management

20 thoughts on “Recursion – Part 7 of Functional Programming in JavaScript

  1. How'd you get the categories.filter(c => c.parent === parent) line to work? When I ran it, I got a "parent is not defined" error which I actually expected just by looking at it, but somehow your console magically made it work?

  2. YES!!! Finally a JS/coding teacher as immature as me with practice variable names! I too name my variables names like "fart", "asshole", or "fuckface" when testing or practicing code – I feel so vindicated right now, lol!

Leave a Reply

Your email address will not be published. Required fields are marked *