---
type: video
yt_id: VVU2YVRMdUlfajQtMHdpRFN6bWFQY3RRLldzYzJ4a3FEczdB
videoId: Wsc2xkqDs7A
title: "JavaScript Recursion Explained"
date: "2022-07-04T13:00:30Z"
slug: "javascript-recursion-explained"
image: 
  name: "javascript-recursion-explained.jpg"
  alt: "JavaScript Recursion Explained"
  width: 1280
  height: 720
status: 'published'
description: "What is recursion and how do you use recursion in JavaScript? In this video I'll explain what recursion is and how you can use recursion to solve recursive problems in JavaScript. I'll also show you how to traverse the DOM using a depth first search."
tags: ['JavaScript', 'js', 'functional programming', 'algorithms', 'trees']
---

What is recursion and how do you use recursion in JavaScript? In this video I'll explain what recursion is and how you can use recursion to solve recursive problems in JavaScript. I'll also show you how to traverse the DOM using a depth first search.

## Chapters:

* 0:00​ Intro
* 0:29 Solving with a for loop
* 5:45 Solving with recursion
* 10:25 What is Recursion?
* 15:26 Recursion in the browser
* 21:29 Depth First Search


