Javascript Nuggets - Promises Example
HTML-код
- Опубликовано: 9 фев 2025
- Javascript Nuggets - Promises
Source Code - github.com/joh...
Project Based Web Dev Courses
www.johnsmilga...
Products I Use:
Microphone - Shure SM7B - amzn.to/3fX55aD
Headphones - Shure AONIC 50 - amzn.to/3zbkxHC
Desk-Mounted Microphone Stand - amzn.to/3x3MBuS
Crossover - dbx 234s - amzn.to/3xcryGC
Audio Interface - Focusrite Scarlett 2i2 3rd Gen - amzn.to/3pt1wMx
Cheaper Microphone (My first mic) - Blue Yeti USB Mic amzn.to/3iliwTm
Blue Light Blocking Glasses - amzn.to/3fZASrv
Apple MacBook Pro 13.3" - amzn.to/3z5QDEK
iMac - amzn.to/3glWmOe
Second Monitor - LG 4K UHD 27UD88 - amzn.to/3ckdwdV
Wifi Router - TP-Link AC1900 - amzn.to/34ZSddz
Desk Chair - amzn.to/3ikNbQJ
Standing Desk - amzn.to/3zdKVAJ
Books I Recommend:
The Subtle Art of Not Giving a F*ck - amzn.to/3v9t8Yi
The Tipping Point - amzn.to/3gCslKj
Atomic Habits - amzn.to/3x52xNa
12 Rules for Life - amzn.to/3gln8pN
Deep Work - amzn.to/3cyAgqu
Digital Minimalism - amzn.to/3gao69A
A World Without Email - amzn.to/351Swoe
Rich Dad Poor Dad - amzn.to/3v8RWQ6
Rich Dad's Cashflow Quadrant - amzn.to/3ivt1Uk
Check out My Amazon Store for more products and books recommendations - www.amazon.com...
Disclosure: This video is not sponsored. Some links above are affiliate links, and l may earn a small commission from any purchases at no additional cost to you. Thank you for supporting my channel!
Well, if John Smilga gives an explanation on something, understanding is guaranteed. Thanks for another demystification.
John Smilga for president!
I appreciate all these videos
Best ever explanation
Gifted teacher… Thanks!!
Glad it was helpful!
brillant teacher omg
it's like callback hell ... but in a fancy way!
It's promise hell
the best one in javascript
Thank you for sharing your knowledge
Nice video to understand the promise
Nice bro.
ooo thanksss ❤️❤️❤️
Welcome 😊
At 11:50 line 14, the last call off addColor didn’t receive the 4th parameter "data".
Doesn’t JavaScript complain about this?
Mismatch between interface of javascript parameters and arguments passed are fine. Extra arguments are ignored, missing arguments are set to undefined if no defaults setup
Thanks
My headings are still going ahead at their pre-set times. they are not waiting for the previous one to carry out it's action first
Can somebody tell me, on MENU project, why the border on the filter buttons have the border color left and up gold and right and down black ? I inspected the buttons, I changed the colour, but still half has a darker colour that the other. Thank you
Sorry, I asked the question at wrong video. I had the videos in a playlist and a new video started
i think i know how to do that 🤓🤓🤓 ! we can say resolve ( data ) in the finctio ! and then each time .. we pass the next color in the parameter of ( then ) ! as a data ... then inside the (then ) we pass the data insted of the color argument
Can't we do the same functionality without promise , only with setTimeout??
yes you can but then it will be a callback hell
This looks like Promise Hell to me.😁
It's actually not because we don't have rewrite the same functionalities again and again
we can simply call an function for that
In .then( ) if you don't callback and directly invoke the addColor( ) then even after commenting out resolve the program works fine ,why is that happening?
The program didn’t work fine. Once he commented out the resolve, addColor only worked the first time it was called and never made it to the first .then(). He said if you console.log you would see that the promise would still be pending.
@@lamb8086 you didn't get my point
@@fugitivemind it gets invoked after you trigger the event ,nothing is change only i invoke the function inside .then( ) like .then( addColor( parameters...) ) , that mean even after commenting resolve .then( ) gets executed; it proves that it does not depend on resolve( ) call but yeah the state is still pending;
Program does not work fine, check the sequence. And the reason for that is because with your suggested setup we invoke addColor(params) right away instead of passing as callback. .then(addColor(params), if you will pass it as a reference .then(addColor), you will see that while the promise is pending it's not going to be invoked.
@@CodingAddict no it works I run the code