Тёмный

JavaScript Memoization Made Simple! 

The Code Creative
Подписаться 13 тыс.
Просмотров 6 тыс.
50% 1

An explanation of memoization in JavaScript. Memoization is a super useful performance optimization technique that can be used to improve the performance of slow running functions. I explain how to memoize in JavaScript in the clearest and most concise way I can! Created by Gregg Fine.
📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:
store.thecodec...
🗣JOIN the Code Creative Facebook group! :
/ 1612600368887577
🔴Subscribe for more free Code Creative videos: : / @thecodecreative
🌐 The Code Creative Official Website
www.thecodecre...
🎓 The Code Creative Courses
www.thecodecre...
✅ Recommended related videos:
Web Audio API: Exploring Oscillators
• Web Audio API - Oscill...
Web Audio API: createOscillator and Audio Nodes
• Web Audio API - create...
Web Audio API: What is Audio Context?
• Web Audio API - Audio ...
✅ For business inquiries contact me at gregg@greggfinedev.com
✅ Let's connect:
Twitter - @GreggFine
Instagram - /greggfinedev
Facebook - /hiddentigermusic

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@TheCodeCreative
@TheCodeCreative 4 года назад
ru-vid.com/show-UCmOpHGj4JRWCdXhllVTZCVw
@clydecalador
@clydecalador 4 года назад
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!
@TheCodeCreative
@TheCodeCreative 2 года назад
📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet: store.thecodecreative.com/google-secrets-cheat-sheet
@TheCodeCreative
@TheCodeCreative 4 года назад
🗣JOIN the Code Creative Facebook group! : facebook.com/groups/1612600368887577
@_____AjCoder______
@_____AjCoder______ 2 месяца назад
this video is so underrated !! good job bro cant be explained any better 👏👏👏
@TheCodeCreative
@TheCodeCreative 2 месяца назад
Glad you liked it!
@MajidJahangir-u6v
@MajidJahangir-u6v Месяц назад
Excellent explanation. The best i have seen on RU-vid
@TheCodeCreative
@TheCodeCreative Месяц назад
Glad it was helpful!
@ninjarogue
@ninjarogue 3 года назад
Hey, where is up with your font? the === and
@TheCodeCreative
@TheCodeCreative 3 года назад
Those are font ligatures for VSCode.
@dougm3162
@dougm3162 Год назад
I only understood half of this, but damn was it cool
@TheCodeCreative
@TheCodeCreative Год назад
👍🏻👍🏻👍🏻
@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!!!
@IbraheemOmar-fn1ze
@IbraheemOmar-fn1ze 2 года назад
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 года назад
@@TheCodeCreative cool. What is that? Also how do i get it?
@TheCodeCreative
@TheCodeCreative 2 года назад
@@IbraheemOmar-fn1ze Here it is: github.com/tonsky/FiraCode
@mohamedyoussef8835
@mohamedyoussef8835 2 года назад
Super Awesome +++++++++++++++++++++++
@TheCodeCreative
@TheCodeCreative 2 года назад
Thank you! Cheers!
@case_tips
@case_tips 2 года назад
Really creative explanation
@TheCodeCreative
@TheCodeCreative 2 года назад
Glad you liked it
@PIYUSH-lz1zq
@PIYUSH-lz1zq 2 года назад
Please bring more such concepts of js with implementation.
@aya2222
@aya2222 2 года назад
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 года назад
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 года назад
@@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 года назад
@@aya2222 Yes, check out Kyle Simpson's series "You Don't Know JS"!
@aya2222
@aya2222 2 года назад
@@TheCodeCreative thank you!! I will check it!!
@TheCodeCreative
@TheCodeCreative 2 года назад
@@aya2222 👍🏻
@aravindm6124
@aravindm6124 2 года назад
Awesome explanation!!!!
@TheCodeCreative
@TheCodeCreative 2 года назад
Glad to hear it!
@ManontheBroadcast
@ManontheBroadcast 4 года назад
if ...args is an array then how can we say cache[args] ? Shouldn't we iterate over each one?
@TheCodeCreative
@TheCodeCreative 4 года назад
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.
@photontube
@photontube 2 года назад
Why is the small number of subscribers here?
@TheCodeCreative
@TheCodeCreative 2 года назад
RU-vid is a tough nut to crack! :-)
@photontube
@photontube 2 года назад
@@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!
@zameeebasha
@zameeebasha 4 года назад
Can't get clear than this. Great job Gregg. 🙏
@TheCodeCreative
@TheCodeCreative 4 года назад
Hey Zameerbasha, thanks!
@neilstrong1735
@neilstrong1735 2 года назад
You are using closure concept
@Troy-ol5fk
@Troy-ol5fk 2 года назад
Please make a video about browser devtools
@TheCodeCreative
@TheCodeCreative 2 года назад
Great idea. Anything in particular about the devtools?
@Troy-ol5fk
@Troy-ol5fk 2 года назад
@@TheCodeCreative The breakpoints seems difficult to me
@TheCodeCreative
@TheCodeCreative 2 года назад
@@Troy-ol5fk ​ Gotcha. Yes, those can be confusing. Thanks for the suggestion!
@nerogatonevoso945
@nerogatonevoso945 4 года назад
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 года назад
That sounds like a great thing to do with the Underscore library 👍🏻 Glad this was helpful Nero. Thanks for watching!
@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 года назад
...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.
@blogtapri
@blogtapri 3 года назад
Great explanation. In React there is a React. memo hook. Does this concept work behind the scene there?
@TheCodeCreative
@TheCodeCreative 3 года назад
Thanks Vikram!, Yes, useMemo works with the concept of memoization.
@caizza3
@caizza3 3 года назад
Such a beautiful explanation, in-depth yet clear. Thanks!
@TheCodeCreative
@TheCodeCreative 3 года назад
Glad to hear, thanks for watching!
@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😁
@yusefdaramay2177
@yusefdaramay2177 2 года назад
That was such a great explanation! Thanks 🙏
@TheCodeCreative
@TheCodeCreative 2 года назад
Thanks for watching Yusef!
@manedurphy
@manedurphy 4 года назад
Excellent explanation. Subscribed.
@TheCodeCreative
@TheCodeCreative 4 года назад
Thanks Dane and thanks for watching!
@tanzeemahmed8609
@tanzeemahmed8609 4 года назад
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 года назад
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 года назад
Also, here's a video explaining the Rest Parameter: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qla3bATsadw.html
@tanzeemahmed8609
@tanzeemahmed8609 4 года назад
@@TheCodeCreative makes sense to me now.
@TheCodeCreative
@TheCodeCreative 4 года назад
@@tanzeemahmed8609 👍🏻
@ShreyasKumar
@ShreyasKumar 3 года назад
LOVED IT
@TheCodeCreative
@TheCodeCreative 3 года назад
Great, thanks for watching!
Далее