• Tuesday , 19 November 2019

JavaScript Promises In 10 Minutes

Code Canyon



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.

Code From This Video:
https://codepen.io/WebDevSimplified/pen/jXoXYj

Twitter:

GitHub:
https://github.com/WebDevSimplified

CodePen:
https://codepen.io/WebDevSimplified

#JavaScript #Promises #WebDevelopment

Original source

3d Ocean

Related Posts

38 Comments

  1. Web Dev Simplified
    November 6, 2019 at 18:32

    If you enjoy promises make sure to checkout Async/Await.
    https://youtu.be/V_Kr9OSfDeU

  2. Jason Thomas
    November 6, 2019 at 18:32

    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!

  3. NOLONHUM
    November 6, 2019 at 18:32

    Thanks dude!

  4. Felipe Caballero Gil
    November 6, 2019 at 18:32

    Hi there, great video!

    Just a clarification from what I understood reading https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise , apparently the New Promise starts running its code as soon as it's defined ("the executor is called before the Promise constructor even returns the created object") so when you say that Promise.all will run the promises, from my understanding what actually happens is that every Promise gets executed at the moment they are created and Promise.all constantly checks if all are done. It's a matter of sequence, the Promise.all doesn't actually executes but waits for the results…

  5. Dmitri Goncharov
    November 6, 2019 at 18:32

    Gosh, I was trying to understand promises for like ever and you made it so easy. Great job!

  6. Nizamuddin Shaikh
    November 6, 2019 at 18:32

    JavaScript Promises are so simple, and of course, can be so useful! Excellent explanation and example given! Thanks.

  7. Rafael Lima
    November 6, 2019 at 18:32

    Gezz, so easy to understand it with you!!! Thanks so much!!

  8. Dominic Lapitan
    November 6, 2019 at 18:32

    The best tutorial on Promises! Thank you for your videos and efforts. Much appreciated.

  9. Jesrel Rusiana
    November 6, 2019 at 18:32

    Promise. What a weird name. BUT it helps a lot.

    – In reality, I have a trust issue.

  10. Faruk Abdulla Munshi
    November 6, 2019 at 18:32

    Awesome!!!

  11. nur amalina
    November 6, 2019 at 18:32

    Hey, thanks a lot for the video. Worth every minutes!

  12. Damilola Oluwafemi
    November 6, 2019 at 18:32

    I've been telling everyone about this channel, you are a very good teacher.

  13. Josh3292
    November 6, 2019 at 18:32

    I don't understand how function 5:17 works fine if we don't feed "callback" and "errorCallback" arguments to it in the watchTutorialCallback.

  14. Feranmi Africa
    November 6, 2019 at 18:32

    I so much like you… Even if I haven't studied js.. your tutorial always help me in solving small probs in my projects.. now I promise to learn JavaScript

  15. Phea utube
    November 6, 2019 at 18:32

    Great explanation thank you

  16. Peter Tester
    November 6, 2019 at 18:32

    Hi, Could you please make a video explaining the auto completion information in visual studio code. A break down of that would be useful. I mean all the information that comes with a method, constructor etc. Generally I understand the concept, but I have to remind myself sometimes. I think people might benefit from it.

  17. DreamCode
    November 6, 2019 at 18:32

    great video 👍

  18. shinichixxxx
    November 6, 2019 at 18:32

    thank you.
    subscribed

  19. Mounoy Dev
    November 6, 2019 at 18:32

    thank

  20. peanuts red
    November 6, 2019 at 18:32

    simple to understand

  21. lazood company
    November 6, 2019 at 18:32

    very nice and practical tutorial. Thanks,guy.

  22. vibonacci
    November 6, 2019 at 18:32

    Good video, but I think you missed mentioning asynchronousness. It would make more sense to use a public api to fetch data then to just run synchronous code inside the promise.

  23. Alacris
    November 6, 2019 at 18:32

    Great explanation. Thanks!

  24. Raj Raj
    November 6, 2019 at 18:32

    Please use background color white

  25. HellaDev
    November 6, 2019 at 18:32

    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.

  26. Varun Sud
    November 6, 2019 at 18:32

    That feeling as a Java developer to see statements ending without semi-colon…

  27. Jayanta Paul
    November 6, 2019 at 18:32

    Really good tutorial. Perfect explanation and very easy to remember. Thanks !✌👏

  28. mandira mainali
    November 6, 2019 at 18:32

    Sir I have used promise.all with settimeout function but resolved messages of array is shown immediately

  29. HIMEL SARKAR
    November 6, 2019 at 18:32

    Show us about playing with string email id and phone number in JavaScript?

  30. Deepak Surya
    November 6, 2019 at 18:32

    You just made THE BEST video promises bro. You rock!

  31. Jason Ching
    November 6, 2019 at 18:32

    Thx for the video, but I believe this is not completed. The exist of promise is to resolve callback hell. The video should explain more about this. And more important, async/await is missed out in this video. That's a very strong reason to use promise. From a async function, the promise will be returned implicitly. Using await can make your code a lot cleaner then using callback. That's the standard use case of promise.

  32. TVO
    November 6, 2019 at 18:32

    Super Great!!!!

  33. Alexander White
    November 6, 2019 at 18:32

    youtube.addEventListener('load', () => {
    checkOut(recommended());
    });

    async function checkOut(video) {
    let result = await watch(video);
    if (result.channel=== 'Web Dev Simplified') { like(); comment(); return next(); }
    close();
    }

  34. Surya Pratap Singh
    November 6, 2019 at 18:32

    Great and super simple. Thanks

  35. Mike Maloy
    November 6, 2019 at 18:32

    This was the first time I've watched an explanation of promises that made sense.
    You are a magnificent instructor. Thank you! 🙂

  36. Pushpak Gupta
    November 6, 2019 at 18:32

    Brad traversy is a great teacher and no disrespect to him but you explain things in a much simpler manner.Thanks man

  37. Justin Julian
    November 6, 2019 at 18:32

    Promise resolved! Thank you.

  38. AJEET SINGH
    November 6, 2019 at 18:32

    Great explanation. Thanks

Leave A Comment

You must be logged in to post a comment.