JavaScript Memoization Made Simple!

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 67

  • @TheCodeCreative
    @TheCodeCreative  4 года назад

    ruclips.net/channel/UCmOpHGj4JRWCdXhllVTZCVw

  • @clydecalador
    @clydecalador 4 года назад +9

    With such explanations I really hope your number of subscribers increases dramatically. This was by far the best explanation I have seen on this topic. Keep doing what you're doing, you have a gift for teaching!

    • @TheCodeCreative
      @TheCodeCreative  4 года назад

      Hi Clyde, glad to hear it. Thanks for the comment!

  • @_____AjCoder______
    @_____AjCoder______ 4 месяца назад +1

    this video is so underrated !! good job bro cant be explained any better 👏👏👏

  • @MajidJahangir-u6v
    @MajidJahangir-u6v 3 месяца назад +1

    Excellent explanation. The best i have seen on RUclips

  • @TheCodeCreative
    @TheCodeCreative  4 года назад

    🗣JOIN the Code Creative Facebook group! :
    facebook.com/groups/1612600368887577

  • @TheCodeCreative
    @TheCodeCreative  2 года назад

    📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:
    store.thecodecreative.com/google-secrets-cheat-sheet

  • @zameeebasha
    @zameeebasha 4 года назад +2

    Can't get clear than this. Great job Gregg. 🙏

  • @nerogatonevoso945
    @nerogatonevoso945 4 года назад +1

    Great explanation! I am making some of Underscore library methods from scratch (for a bootcamp) and was stuck on _.once and _.memoize, but that helped me understand not only about caching but also to be able to do the _.once function, which has similar principles. Thanks!

    • @TheCodeCreative
      @TheCodeCreative  4 года назад +1

      That sounds like a great thing to do with the Underscore library 👍🏻 Glad this was helpful Nero. Thanks for watching!

  • @caizza3
    @caizza3 3 года назад +1

    Such a beautiful explanation, in-depth yet clear. Thanks!

  • @yusefdaramay2177
    @yusefdaramay2177 2 года назад +1

    That was such a great explanation! Thanks 🙏

  • @aravindm6124
    @aravindm6124 2 года назад +1

    Awesome explanation!!!!

  • @yuanzhang8956
    @yuanzhang8956 2 года назад

    subscribed! Thanks for the video. I will def check more of your videos! I still have a question, if we run the memoize function for two times, doesnt the catch get reassign as am empty obj again? Coz the first line of the code to make it an empty obj??Thanks in advance!!!

  • @PIYUSH-lz1zq
    @PIYUSH-lz1zq 2 года назад +1

    Please bring more such concepts of js with implementation.

  • @case_tips
    @case_tips 3 года назад +1

    Really creative explanation

  • @aya2222
    @aya2222 2 года назад +1

    Very clear explanation and example!!! Super helpful!! Thank you so much!!!! I also watched your "debounce" video, also wonderful tutorial!! Btw, Do you think your playlist "Javascript" is for people who are learning Advanced JS? I want to learn Advanced JS since I finished basic tutorial and I wonder if the playlist is for me.

    • @TheCodeCreative
      @TheCodeCreative  2 года назад +1

      Great! Your'e welcome! Yes, that JavaScript playlist has some advanced topics. In particular, I'd check out the videos on the Comparator function, the Rest and Spread Operators, Reduce, and Hoisting. Cheers!

    • @aya2222
      @aya2222 2 года назад +1

      @@TheCodeCreative Thank you for your reply! I will finish your Javascript playlist!! Btw, do you have any recommended books to deepen our understanding for these JS concepts?

    • @TheCodeCreative
      @TheCodeCreative  2 года назад +1

      @@aya2222 Yes, check out Kyle Simpson's series "You Don't Know JS"!

    • @aya2222
      @aya2222 2 года назад +1

      @@TheCodeCreative thank you!! I will check it!!

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      @@aya2222 👍🏻

  • @manedurphy
    @manedurphy 4 года назад +1

    Excellent explanation. Subscribed.

  • @subhashgn1775
    @subhashgn1775 3 года назад

    Very well explained.
    Thank you.
    I have one question, if we are passing only one argument to the function why are using ...arg?

    • @lexarisa8418
      @lexarisa8418 2 года назад +1

      ...arg allows the flexibility of passing several arguments. Only in this case are we passing only one argument. Hope this helps

    • @subhashgn1775
      @subhashgn1775 2 года назад

      @@lexarisa8418 Thank you.

  • @beingviksa
    @beingviksa 3 года назад +1

    Great explanation. In React there is a React. memo hook. Does this concept work behind the scene there?

    • @TheCodeCreative
      @TheCodeCreative  3 года назад +1

      Thanks Vikram!, Yes, useMemo works with the concept of memoization.

  • @dougm3162
    @dougm3162 Год назад +1

    I only understood half of this, but damn was it cool

  • @ninjarogue
    @ninjarogue 3 года назад +1

    Hey, where is up with your font? the === and

  • @jacinyan3893
    @jacinyan3893 3 года назад

    Hi, just wondering if you can make a video to relate this to React memoization and hooks, say useMemo and useCallback. I think that would be highly appreciated by a lot of us😁

  • @IbraheemOmar-fn1ze
    @IbraheemOmar-fn1ze 2 года назад +1

    Noticed some of your symbols look different? Are you using an extension to change this?

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      Those are fira code ligatures

    • @IbraheemOmar-fn1ze
      @IbraheemOmar-fn1ze 2 года назад +1

      @@TheCodeCreative cool. What is that? Also how do i get it?

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      @@IbraheemOmar-fn1ze Here it is: github.com/tonsky/FiraCode

  • @ShreyasKumar
    @ShreyasKumar 3 года назад +1

    LOVED IT

  • @ManontheBroadcast
    @ManontheBroadcast 4 года назад +1

    if ...args is an array then how can we say cache[args] ?
    Shouldn't we iterate over each one?

    • @TheCodeCreative
      @TheCodeCreative  4 года назад +2

      We don't have to iterate because if we store an array as the property on the object it will be coerced to a string.

  • @Troy-ol5fk
    @Troy-ol5fk 2 года назад +1

    Please make a video about browser devtools

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      Great idea. Anything in particular about the devtools?

    • @Troy-ol5fk
      @Troy-ol5fk 2 года назад +2

      @@TheCodeCreative The breakpoints seems difficult to me

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      @@Troy-ol5fk ​ Gotcha. Yes, those can be confusing. Thanks for the suggestion!

  • @neilstrong1735
    @neilstrong1735 2 года назад

    You are using closure concept

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 года назад +1

    Super Awesome +++++++++++++++++++++++

  • @tanzeemahmed8609
    @tanzeemahmed8609 4 года назад +1

    I am a noob in JS. Can someone please explain the syntax of function that is getting returned from memoize. How do we have access to ...args and how does args get value from outside, why can't I console.log ...args as first line inside the memoize function. I really can't get my head around the return function syntax

    • @TheCodeCreative
      @TheCodeCreative  4 года назад +1

      Hi Tanzeem, the "memoize" function returns a function. So, if we invoke "memoize", we can assign its result(the function that gets returned) to a variable. Since that variable is now a function, we can invoke it and pass in an needed arguments. And we can use the "rest" parameter(...args) to gather up those arguments.

    • @TheCodeCreative
      @TheCodeCreative  4 года назад +1

      Also, here's a video explaining the Rest Parameter: ruclips.net/video/qla3bATsadw/видео.html

    • @tanzeemahmed8609
      @tanzeemahmed8609 4 года назад +1

      @@TheCodeCreative makes sense to me now.

    • @TheCodeCreative
      @TheCodeCreative  4 года назад

      @@tanzeemahmed8609 👍🏻

  • @photontube
    @photontube 2 года назад +1

    Why is the small number of subscribers here?

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      RUclips is a tough nut to crack! :-)

    • @photontube
      @photontube 2 года назад +1

      @@TheCodeCreative I hope your channel will be one of the leading dev solution hub after atmost a year. Keep teaching us sir. Thank you.

    • @TheCodeCreative
      @TheCodeCreative  2 года назад

      @@photontube Thanks! I appreciate it!