This is how I recommend you learn Recursion in Javascript

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2022
  • Teaching how to learn recursion and explaining a couple of examples.
    My VSCode Extensions:
    - theme: material community high contrast
    - fonts: Menlo, Monaco, 'Courier New', monospace
    - errors: Error Lens
    - extra git help: Git Lens
    - tailwind css intellisense
    - indent rainbow
    - material icon theme
    - prettier & eslint
    - ES7+ React Snippets
    ------------
    🤑 Patreon / webdevjunkie
    🔔 Newsletter eepurl.com/hnderP
    💬 Discord / discord
    📁. GitHub github.com/codyseibert/youtube

ความคิดเห็น • 38

  • @jjfattz
    @jjfattz ปีที่แล้ว +23

    I love that you used the debugger. It’s such a powerful yet typically underutilized tool that we have at our disposal.

    • @Steel0079
      @Steel0079 ปีที่แล้ว +2

      console.log(debugger)

  • @twentyhate
    @twentyhate ปีที่แล้ว +1

    I just want to thank you for your videos that I watch from time to time. I'm kind of "specialized" in Laravel but I like the fact that you explain very well, and that it can apply to any language.

  • @MrZeroowner
    @MrZeroowner ปีที่แล้ว

    Hey, man. That was awesome. I loved how simple and yet how deeply this video was.

  • @chenph6904
    @chenph6904 ปีที่แล้ว

    First attempt to learn resursion. Your exaplanation is clean and clear. It must be helping a lot for a deeper study of recusion!

  • @Kay8B
    @Kay8B ปีที่แล้ว +25

    Can I please request you use dark mode on Excalidraw, the contrast from your editor to the excalidraw hurt my eyes lol

  • @petermckeever2360
    @petermckeever2360 ปีที่แล้ว +1

    Nice work, Cody. Tree structure definitely a good way to explain

  • @ubitubee
    @ubitubee ปีที่แล้ว

    Thanks a lot, it's starting to make sense now. It's actually just a loop written differently when you think about it

  • @Sijo2
    @Sijo2 4 หลายเดือนก่อน +1

    Thank you for your examples and explanations

  • @k3tna
    @k3tna ปีที่แล้ว

    Great explanation, especially if you knew it but need a refresher

  • @CottidaeSEA
    @CottidaeSEA ปีที่แล้ว +5

    I rarely find recursion useful outside of traversing trees, in which case it's a great approach. Loop through objects, if it has children (or a parent if traversing in that direction) then you just keep traversing until you find what you want, or until you achieve the desired result.
    I also use recursion for some maze algorithms I made, but those aren't too dissimilar to trees. It's a node based system at the very least, where each node has siblings.

    • @KyselPoints
      @KyselPoints ปีที่แล้ว

      I was unable to see contents of stack in chrome browser, can you help?

    • @CottidaeSEA
      @CottidaeSEA ปีที่แล้ว

      @@KyselPoints You'll probably find a good answer on StackOverflow, but sure, I might be able to help. What is it that you need to do? If you're talking about the call stack, if you press F12 and click the "Sources" tab you'll see it if you use debugger.

  • @ikai2
    @ikai2 ปีที่แล้ว

    Great video, please do more Vanilla Javascript videos. you're a great teacher.

  • @MohammadAbrar-tx3fc
    @MohammadAbrar-tx3fc 8 หลายเดือนก่อน

    This really helped me learn

  • @stephanykleen2075
    @stephanykleen2075 ปีที่แล้ว

    any way you could do a video with that last permutation exercise? that's exactly what I am looking to learn.

  • @dws98
    @dws98 ปีที่แล้ว

    finally, I understand it. thank you bro XD

  • @lakshmitech4702
    @lakshmitech4702 ปีที่แล้ว

    Your channel is 💎 to me.

  • @michaelharrington5860
    @michaelharrington5860 6 หลายเดือนก่อน

    Tower of Hanoi is the real ball buster

  • @Ptbcpr
    @Ptbcpr ปีที่แล้ว +1

    im still a little bit confused. how does the function know to add all of the results of the recursive function up to create the result when its not state in the function at any point ?

  • @aryaprima6626
    @aryaprima6626 11 หลายเดือนก่อน

    Good Tutorial

  • @SeibertSwirl
    @SeibertSwirl ปีที่แล้ว

    Good job love ❤️

  • @Nil-js4bf
    @Nil-js4bf ปีที่แล้ว

    I've been doing a few challenges from the "type-challenges" repo on github every day (treating it like a daily wordle puzzle) and it's forced me to get comfortable at recursion. That said, the lack of ability to debug a typescript function isn't great for learning. Also the challenges on that repo could be arranged in a better order. Some of its early stuff isn't exactly "easy" and some require really weird tricks which are nice to learn but can result in you wasting a lot of time if you try to do it yourself without looking at the solution.

  • @FrostTyler
    @FrostTyler 7 หลายเดือนก่อน

    I understand the concept of recursion perfectly, but I have no idea how to implement it. It's so mindbending trying to figure out what each step is accomplishing in the recursive body, and it just makes me want to rip my hair out.

  • @KyselPoints
    @KyselPoints ปีที่แล้ว

    I was unable to see contents of call stack in chrome browser, can you help? I followed your steps, still it did not work.

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว

      It should be there if you have a debugger stopped in a function somewhwre

  • @MrEnsiferum77
    @MrEnsiferum77 ปีที่แล้ว

    Or u can use reduce function and using it as tail recursion.

  • @bartoszwierzbicki5994
    @bartoszwierzbicki5994 ปีที่แล้ว +1

    i get why fib 2 + fib 1 is fib 3, but i don't get why fib 3 + fib 2 is fib 4 :P. Can some one explain me this little detail?

    • @sontredis2579
      @sontredis2579 ปีที่แล้ว

      I believe it’s asking for the answers of fib(3) and fib(2) and adding them together to get fib(4) which is 3. Fib(2) and fib(3) is 2+1

  • @Segev031
    @Segev031 ปีที่แล้ว

    The first element in Fibonacci series is 0!!!
    Great tutorial tho

  • @mouhamaddiop1144
    @mouhamaddiop1144 ปีที่แล้ว

    Vous aviez raison de dire que le factoriel peut être un cas d'utilisation de la récursivité.

  • @kenosabi
    @kenosabi ปีที่แล้ว

    I feel like this took a confusing topic and somehow managed to make it more confusing.

  • @Afreshio
    @Afreshio ปีที่แล้ว +1

    it was amazing until the fibonacci example where it felt a bit convoluted and it was kinda complicated to follow the callback stack and the explanation. just my $0.02

    • @WebDevCody
      @WebDevCody  ปีที่แล้ว

      I’ll try better next time

    • @KyselPoints
      @KyselPoints ปีที่แล้ว

      I too did not understand the call stack thing. It simply did not work in my chrome browser. Can you help?

  • @zaklettrezvenik
    @zaklettrezvenik หลายเดือนก่อน

    if this guy actually spends time to organize his explanations, he would be the best, no doubt! thanks, but in many points of the vid, you literally distracted me by making some mistakes, that were just caused by the fact that you explain on LIVE, or idk. but yeah, take that into consideration :) thank uuu for the explanations tho !!