JavaScript Promises In 10 Minutes
ES6 came with many new features, but one of the best features was the official introduction of Promises. Promises allow you to write clean non-callback-centric code without ever having to worry about callback hell. Even if you never write your own promise, knowing how they work is incredibly important, since many newer parts of the JavaScript API use promises instead of callbacks. Checkout the full video to learn how to define and use promises.
Promise Article: blog.webdevsimplified.com/202...
Code From This Video:
codepen.io/WebDevSimplified/p...
Twitter:
/ devsimplified
GitHub:
github.com/WebDevSimplified
CodePen:
codepen.io/WebDevSimplified
#JavaScript #Promises #WebDevelopment
Пікірлер: 1 500
If you enjoy promises make sure to checkout Async/Await. kzread.info/dash/bejne/iJN_1JuIg8mqlbg.html
@maxrockbin
5 жыл бұрын
Did something go wrong with the video upload? I'm seeing your VS Code video instead of your JScript promises video
@WebDevSimplified
5 жыл бұрын
It sounds like a problem with KZread. That has happened to me before. Just try refreshing the page. That usually fixes it for me.
@manishpingale6558
4 жыл бұрын
Can you create a video on firebase cloud functions
@WebDevSimplified
4 жыл бұрын
I have never used firebase so I am not sure if I will cover it anytime soon
@mpey_project
4 жыл бұрын
is promise doesn't need to be declared first?
"I promise to make the best video on promises I can." I like this guy.
@naynyamish270
4 жыл бұрын
"I promise to make a video on promises the best that I can" or "I promise to make , as best as i can , a video on promise " FTFY
@yansun3808
4 жыл бұрын
Reject his promise. I am kidding :)
@atribhattacharyya2631
4 жыл бұрын
Resolved..:)
@JOc17KER
3 жыл бұрын
00:24
@gianfrancobriones
3 ай бұрын
He should've shown a sample of a minimum time consuming URL visit, not simple artithmetic 1 + 1. I don't like this tutotial. ~04:37
You resolve your promise, you make me fully understand
@WebDevSimplified
5 жыл бұрын
I'm glad I could help
@joma0305
4 жыл бұрын
Sorry for my nooby question, i am more python guy, just starting my journey into js. But i didn't get what for you need "promises"? Why you just don't use "if statement"?
@Al_Gonzo
4 жыл бұрын
@@joma0305 watch the video one more time then because he explained it multiple times
@joma0305
4 жыл бұрын
@@Al_Gonzo i did ut before your comment. If you so smart pls explain
@joma0305
4 жыл бұрын
@@Al_Gonzo or it's just a "sugar" of js pl
When you're self taught your knowledge is all around the place, like you know classes, instantiation, scope, ES6, and a bunch of advanced stuff but don't know basic stuff like git. I'm in the middle of a very async heavy project on Express and was having a hard time with promises. I decided to take the WHOLE day off to look into it and it only took me 11 minutes thanks to this video. Now I can go back to my project with an extra day on my deadline. Thanks man, that was awesome!
@notdaveschannel9843
4 жыл бұрын
"When you're self taught your knowledge is all around the place". Yeah, that's where I am with a lot of coding. I've been using 'async... await' and 'fetch' without really understanding the underlying 'Promise' object. Makes a lot more sense now!
@Meleeman011
2 жыл бұрын
express can do async now lol nice. i since moved on to koa but i use express for future devs that aren't me.
@jonathanr7603
3 ай бұрын
@@notdaveschannel9843 async await is just syntatic sugar, you need to know promises instead
I've been binge watching your videos and they are wonderful. Not too long and not too short while delivering the content clearly. Keep up the good work!!
watchThisVideo.then(() => celebrate()).catch(() => sadness())
@aishahale5504
4 жыл бұрын
watchedTheVideo.then((data)=>{ }).catch((error)=>{ console.log("error: ", error) }); ..................... CONSOLE - error: "PERFECT PROMISE VIDEO FOR BEGINNERS"
@kevinm8865
4 жыл бұрын
@Đeath Vader lol
@garrybogdanho
4 жыл бұрын
cringe (sorry)
After watching crashcourses, long, 45 min videos and articles about promises, I can say this is probably the only video that actually made me understand promises. Wonderfully explained! Thank you so much, you have a new subscriber :) And also... The amount of dislikes says it all.
@WebDevSimplified
5 жыл бұрын
Thank you! I am really glad I could help.
@LFFebro
5 жыл бұрын
You took the same path as myself. I have been taking a marathon of Async Javascript to grasp on for once and for all.
@janithillangakoon6962
4 жыл бұрын
same here
@animeshsharma7332
4 жыл бұрын
Even the official documentation by MDN sucked!!
@faizaanannoor395
3 жыл бұрын
@@animeshsharma7332 true that!
Awesome! I have been struggling with this subject for a whole week. I read every resource I could find on the internet. This video finally made me understand promises in a matter of 5 minutes.
Excellent job! A good example to explain all we need to know about it in a few minutes. No gimmicks, no blabla. Please keep going!
The last 11 minutes and 30 seconds of my life was well spent. Great upload!
@WebDevSimplified
4 жыл бұрын
Thank you so much! I'm glad you enjoyed it.
@samrad6508
4 жыл бұрын
are you dead ?
@luke4502
4 жыл бұрын
RIP
@skiddykakaka9423
4 жыл бұрын
rest in rip
@Al_Gonzo
4 жыл бұрын
The guy liked this 11:31 long video so much that his profile picture is now his new favorite numbers, "3" and "1".
Dude.... that was a CLEAN tutorial. I can easily go back and watch it a few times to practice it. Writing a promise to console log 1,2 and 3, in order, asynchronously , was an interview question. I watched your video to re-learn the syntax. Thanks!
@WebDevSimplified
5 жыл бұрын
I'm really glad the video was able to help!
@divinemasculine3730
2 жыл бұрын
hey man did you get the job?
@jamesonvparker
2 жыл бұрын
@@divinemasculine3730 not only did I get that job. I have just recently accepted an offer from the company behind this very platform 😉.
@divinemasculine3730
2 жыл бұрын
@@jamesonvparker wow youtube??? so inpirational! can you give me tips? im from canada going through a FULL STACK coding bootcamp
@jamesonvparker
2 жыл бұрын
@@divinemasculine3730 find me on linked in. I’ll talk there
there are many webdev videos on youtube but what i like so much about yours is how calm you bring every thing (there is a general hyperactivity trend on youtube i think). videos are very clear as well. thanks so much :)
Bro, been trying to understand this for an hour. Your video was the first where it all clicked. Thanks!
I’ve commented before, basically the same thing, but I REALLY enjoy your style of teaching. To the point, understandable examples, and clean code. This is by far the best video on Promises I’ve seen yet. Thank you!
@WebDevSimplified
4 жыл бұрын
Thank you so much!
Yeah. This is the best video from my Async JS marathon. Superb, right-to-the-point and practical explanations. You did, pal. One more subscriber. Keep up the good work!
Your video is 5 years old, But I think it’s still the best.
Thank you for this video! I didn't feel great about not 'getting' promises entirely, but you explained it in such a way that it 'clicked' in my brain.
guy explained in 11 mins what took hours for my instructor. thank you 🙏
I started learning development with udemy courses. It all went great and I've been through 2 interviews so far. In one of the interviews they told me to learn the theory behind promises and it turned out that I've used it many times but that video really helped me solidify the knowledge and understand the actual logic behind them. I always seek your short and straight-to-the point tutorials for similar cases. Thank you.
This tutorial was like revisiting form basics to learn to pro. I read some articles about Promises and I sort of knew what this was about. But the way he gave the example, this just got stuck in my mind. thanks man
Within 11 minutes, you have teach the toughest part of javaScript very easily and resolved your promise. Thanks a lot.
I've read so many documentations, watched so many crashcourses to try to understand what Promise is. I couldn't fully grasp its core idea until I watched this video. Your explaination is crystall clear and ver comprehensible. Mega thank you and respect to you and your channel!
@WebDevSimplified
4 жыл бұрын
You are very welcome. I am really glad I could help shed some light on promises!
I am learning a lot from you . Your videos are always to the point . As a self taught programmer, this channel is a gem . Thank you so much : )
@helvosthecreator1920
4 ай бұрын
So how did your self taught programmer journey go? Asking for a friend 😂
Man, you are one of the best instructors I had the pleasure to watch teaching. Your videos worth more than tenths of hours of paid courses. Thank you a lot and greetings from Brazil!
It has taken me years to understand promises but your videos came in handy, I couldn't be any more grateful. Thanks a bunch
I am a very young programmer and Kyle will always be my favorite programming KZreadr out there.
@shwethalok186
3 ай бұрын
Guess my age
I really went down the rabbit hole with this one... Was initially learning about CPU hyperthreading and got confused between concurrency, parallelism, and sync and async tasks. Learning that introduced me to asynchronous code, which finally led me here. I don't even know JS lol. Really good video! I found this quite interesting.
Just want you to know every time I look into learning new things I look for your videos first. You are the best teacher I've ever had
I have spent so long trying to fully grasp node promises and this video really really explained it such an understandable way, you have earned yourself a new subscriber! :)
This channel is massively underrated 🙌🏻
@WebDevSimplified
5 жыл бұрын
Thanks! I think 4,000 is a pretty huge number already, but I am excited to see what the future holds.
@techuchiha6510
4 жыл бұрын
See this is what I was talking about!!! Way to go buddy!!!
@vmusatov
3 жыл бұрын
@@udeleted almost doubled 3 months later. Race for a million. I’m a new sub
Dude, your tutorials are amazing. Thanks for everything you teach us. Greetings from Costa Rica
@WebDevSimplified
5 жыл бұрын
Thank you! It always amazes me how many people from all over the world have seen one of my videos.
Thank you for your excellently designed tutorial on promises.I grasped all the concepts and I feel pretty wholesome. All the codes were just ‘spot on’. Kudos to you for making such an excellently orchestrated tutorial. 🤗
You definitely kept your promise about the video. Good work!
@WebDevSimplified
5 жыл бұрын
Thanks! I'm glad you enjoyed it
Wow, this made much more sense than the udemy course I'm taking right now.
Spent 2 hours yesterday trying to figure this out. 7 minutes into your video it suddenly makes sense. Thanks for making a great video.
Top explanation. You are naturally gifted with the power to simplify things. Was stuck on the topic for about an hour. Crazy that i could understand this in just 11 minutes
I learned more about promises from this ten-minute video than I did from an entire fifteen week web dev course in school. Can't thank you enough!
@WebDevSimplified
5 жыл бұрын
I'm really glad I could help!
@GMIX
5 жыл бұрын
Web deb course in school? I could only dream about this. The only thing i've learnt from school is how to open ms word.
This is amazing! Thank you so much 😊. You explained this perfectly. I have been trying to learn this for weeks and I’ve been failing but I just learned it in 10 minutes! I completely understand this now, thank you! YOU HAVE A NEW SUBSCRIBER 😄😄
@WebDevSimplified
4 жыл бұрын
Thank you so much! I am really glad I could help, and I hope my other videos are just as helpful.
@rmewse3616
4 жыл бұрын
Web Dev Simplified thank you
2 min in and it made more sense than the 5 or so written tutorials I found online. Thanks. Your promise has been resolved
So far your video was the best one I've seen explaining Promises and I'm thankful to you for that, I actually understood what Promise is.
I watched 4-5 other videos about callbacks, promises before watching this video, was not satisfied. I am very much satisfied with your explanation in just 10 mins. Great 👍
@WebDevSimplified
4 жыл бұрын
Thank you! I try to make all my videos as concise and informational as possible. My goal is the be the channel with the most learning per minute of content.
@chris94kennedy
4 жыл бұрын
@@WebDevSimplified Yeah think we can all agree you're pulling that one off. Congrats on your engagement also, huge
Fantastic explanation! My only feedback is to increase the font size in your editor for those of us watching on mobile (and I'm sure desktop would benefit) when doing these smaller examples. Would be a lot easier to read.
Been stuck on learning Promises as a beginner and this has helped tremendously! Cheers!
You have fulfilled the promise of conveying the tutorial of "Promises" in a very promising manner. I have liked, comment and subscribed :D
I read the entire MDN section on Promises and 11 mins convert me into a promise pro thank you sir
How do you speak so flawlessly without pauses or ticks, all while typing out code with very few mistakes? Was this all one take? This shouldn't be possible
i started with the full stack course but have digressed 4 videos now in order to catch my knowledge up. thank you for referencing these videos that contain the requisite knowledge i didnt even know i was looking for!
You just saved me man. I've been reading my course material over and over, watching their videos for days and I wasn't computing a thing. You're doing the Lord's work, Bravo!
Also the .then can take two functions as arguments. The first one being done on resolve and the second one for reject. .catch is the same thing as .then(null, reject)
@DamianDemasi
2 жыл бұрын
.catch is not exaclty the same, becasue you can use different a "reject" for every .then, and use a common .catch at the end of the chain to catch any unhandled error.
Thank you so much for your videos! You have a great talent for teaching :D I wish college teachers were like this, mine would only read their PPT in class :(
Probably the best video on KZread that explains promises in such a lucid fashion. Liked, commented, subscribed and shared as well. Keep up the good work man.
I FINALLY understand promises, thank you! Why has no one else made it this simple?! Much appreciated!
You have explained it so well, thank you
@WebDevSimplified
5 жыл бұрын
I'm glad I could help.
"...and that cats are better than me" 🤣 Thanks for your help
@WebDevSimplified
5 жыл бұрын
You're welcome! I'm glad I could help.
After a lot of reading and a few re-watches of your tutorial, I finally have a basic understanding. Thanks!
i took a seminar of this video and i got appreciation from my manager and my team mates. Thankyou for the video
The promise code for the first example gave me a “Promise {}” when a = 2. It gave me the correct result when a = 3. Ran straight and with localhost. Both were the same, thoughts?
@WebDevSimplified
5 жыл бұрын
It sounds like your promise is never calling resolve or reject. You might want to check to make sure that your if logic is correctly setup so that either resolve or reject are always called inside your promise.
@techhousemedia8727
3 жыл бұрын
Promise has three states which are; 1. Pending, 2. fulfilled and 3. reject. when you defined a promise in a function, that function remains in a pending state untill you run the code and now result in a certain condition base on your logic, that is when the function will enter into being fulfilled or rejected.
@FaceMaskHenry
2 жыл бұрын
you can try "Promise(**).then(**).then(**)". Means try to see in second "then"
That feeling as a Java developer to see statements ending without semi-colon...
@WebDevSimplified
4 жыл бұрын
It is a great feeling.
@DutchRatedGamers
4 жыл бұрын
@@WebDevSimplified While I like it, I consider it a bad practise whether it's allowed or not. But I find JS rather messed up anyway. -- Don't attack me on it though, I use it when needed (Which is currently using NodeJS + Electron).
I was comfused by promises for a long time , this video really help a lot .simple and clear .Thanks man
Honestly I'm addicted to your videos, so simply explained. THANK YOU A LOT!!!!!
So like then ==> runs for resolve and catch ===> runs for reject
Dislikers thinking that button is for download this 😂
@karthikmatreddy7095
4 жыл бұрын
😂
Kyle you are legit one of the best out here, the way you explain is so simple yet spot on. Thank you so much man....
I came here to understand promises, callbacks, arrow functions as these are extensively used in Block chain for JavaScript representation of smart contracts. After watching your videos, I developed an interest in learning the whole JavaScript. Such a simplest explanation. You indeed lived up to your promise of delivering a good Promises tutorial!!! Good job! Keep it up!. You got a new subscriber! :)
Why do all coding tutorials have these comments like 'super simple explanantion' "best video ever" ...no matter how bad the explanation was. It will always be a mystery to me
You completely resolve your promise and got success in your ideas of teaching viewers about Promises. Thanks.
It`s been such a challenge to understand Promise, callbacks, tasks, schedules, async/await ugh!! This explanation was the clearest one so far! Thank you !!
Ok. Two things: 1) slow down about 2-3x. 2). As someone that is being forced to take JavaScrip for a CS major, I can't help but notice how terribly JavaScrip is compared to other programming languages... literally feels like a house made of scraps ... there just isn't any clear consistency or common sense built into this language ... it's all just a bunch of strung together libraries and weird syntax that was build over whatever was there before ... everything seems to be based on word of mouth and experience rather than the structured and consistent approach used by other programming languages. I thought Python was terrible, but JavaScrip takes it to the next level of confusion. Somehow the claim is that this makes things faster and easier, but all I see is a bunch of unnecessary complexity that could be simplified by going back to the basics.
@ITSplit
7 ай бұрын
You are so right about this!
@karthickselvam8606
6 ай бұрын
Dude Javascript is a language that was built for browsers initially.Today the many versions of JS introduced new syntax which is confusing but there is a reason behind the weird things of JS. Its cause of 2 things they are doing at the same time, one is they don't want to break the code written a long time ago another is they are making development easy for the devs by implementing new features and syntaxes..Javascript should have a backward compatibility always.
@Henry_Red
5 ай бұрын
Bro, what are you talking about? I had to put the video in 1.25x because it was too slow.
Thank you so much! Sometimes, if I find topics complicated, I feel like I can't breath and take lots and lots of break. lol. But this tutorial makes it easy to understand the topic.
Ok, cool! Thanks for sharing those examples. I was terrified of the Promise Object. Now I can use it for my school project! Perfect tutorial!
This is defintely the best intro to promises I've come across. Great job!
You really simplified my javascript learning journey thank you kyle, Hats off for you 🎩
Just wanted to say great Job! This is the best explanation on Promises that I've came across. Kyle You Are Resolved!
bro so simple and so straight and so much to digest in single video. very much appreciated.
I am an experienced developer but haven't used promises till now, there was piece of code I was trying to make sense from another developer and he as using promises. This video really help me in this regard. Thanks
Best video on promises. I have seen so many videos but none of them made sense to me except yours. Thank u
You are really capable of making complex things much simpler, the way you describe is awesome, definitely you resolved your promise to make best video ever on promise :)
Thank you for getting straight to the point. Im glad you used only the resources needed for learning this topic. Well done.
When I need to learn something about web, I first look into this channel. He never disappointed me!
Your clarity and detailed explanation is a goldmine!! Subscribed pretty much immediately lol
Was reading the MDN article over Promises and half way through I was already falling sleepy. decided to come here instead and understood it lol. Thanks m8
okay !!this is something which defines this youtube channel extremely simplified thanks buddy 😊
One of the best quick and simple explanation of concepts! thanks @ Web Dev Simplified. Promise resolved!
After viewing this video, Promises are starting to make sense! Thank you.
This was simple, clear and straight forward. Great job, thank you for putting in the time.
Thanks Kyle! You are such a good teacher and explain things so well. I have wasted hours trying to figure out promises :)
Thanks, Kyle. You make the best JavaScript tutorials on KZread. Not one of the best, but the best.
This is by far the best video I have watched explaining promises in Javascript. Thanks @Web Dev Simplified
Thank you! This helped! I still think I need to watch this video 10 times to make it stick! I always come straight here for help, much appreciated :)
Truly a good video. You are really exceptional then others on youtube and just give exactly what as a learner we want. Appreciate your knowledge, hardwork and efforts towards this. Even after 3 yrs, I could not find video better than this. Excellent !!!!
Finally, i was able to understand Promises...It took me whole 2 day to understand it...Thank you so much
This channel needs way more credibility and subscribers than it does at the moment. Best web dev channel in whole of youtube. Thanks Kyle.
Og God, I had to reread that a couple of times to understand how "message" or "error" were getting their info from. Got it, levelled up!
i seriously watched so many fucking videos on that topic and never wrapped my head around it... you took 10 minutes and now i feel comfortable to play around with it.. thank you.
I learned more about promises and callbacks here then on any other place. It is short but understandable. Other videos too. Congratulations.
Thank you so much for taking the time to create this tutorial. I was struggling with this and needed this helped so much.
Thank you. You are the best to explain! I'm glad to find your videos, Kyle!
We all have to appreciate your effort for making this simple
definitly te best javascript promise tutorial, i was having a hard time to learn promises until i watch this video
Thank you for all these videos!!! Your explanations make it so simple to understand! 🙏🏼