Recursion - Javascript In Depth

Publié le: 02 December 2022
sur la chaîne: Tech with Nader
3,563
184

We take a look at recursion and how we can implement it in Javascript together. Recursion allows us to call the function we are in from within itself and setup cases where we can break out of the "recursive loop". We see some cases where we need recursion to solve certain types of problems that would be a struggle with constructs like loops or functions.

We go through a few "simpler" examples followed by a more complex but realistic example of recursion over a tree-like data structure (a gold mine). We use this to walk through different mine configurations and trace the code line by line to see what is happening inside the recursive loop.

Note that this is an advanced topic and will take a lot of practice and trying different things over time to really cement. We'll go through some practice exercises together on recursion in the next video in the series.

This is part of a series where we go over Javascript in depth to learn programming concepts as well as web development:    • Javascript In Depth  

Chapters:
00:00 Introduction
02:18 Why Recursion?
05:55 Functions in Functions?
08:48 Intro Recursion Code Example
15:14 Recursion Array Example
27:16 Recursion Return Visuals
29:25 Recursion Gold Mine Adventure - Trees
31:06 Gold Mine Level Design and Goals
32:36 Gold Mine 4 Level Layouts
34:09 Possible Mine Layouts
37:25 Walkthrough 1 Level
38:21 Walkthrough 2 Levels (One side)
41:34 Walkthrough 2 Levels (Both sides)
43:55 Practice Example 3 Levels
44:05 Possible Algorithm
47:20 Coding the Gold Mind Recursion
57:05 Code Walkthrough
1:02:21 Advice to Learn and Practice
1:05:51 Next Steps

📦 Github Repository with the notes and exercise code+solutions: https://github.com/Nooder/javascript-...
💬 Come join us on Discord to chat with a like-minded community about tech and learning:   / discord  
🏅Support the channel and content through Super Thanks, Channel Memberships, or on Patreon:   / techwithnader  


Sur cette page du site, vous pouvez voir la vidéo en ligne Recursion - Javascript In Depth durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Tech with Nader 02 December 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,563 fois et il a aimé 184 téléspectateurs. Bon visionnage!