• Sunday , 31 May 2020

16.13: async/await Part 1 – Topics of JavaScript/ES8

Code Canyon



This video covers the new ES8 “async” and β€œawait” keywords for writing asynchronous functions in JavaScript.

πŸŽ₯ Next Video: https://youtu.be/chavThlNz3s

πŸ”— async on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function

πŸš‚ Website: http://thecodingtrain.com/
πŸ’– Patreon: https://patreon.com/codingtrain
πŸ›’ Store: https://www.designbyhumans.com/shop/codingtrain/
πŸ“š Book recommendations: https://www.amazon.com/shop/thecodingtrain

πŸ’» https://github.com/CodingTrain/website

πŸŽ₯ For more videos on ES6/JavaScript: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YgpA3Oht-7B4NBQwFVe3pr
πŸŽ₯ For more Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

πŸ”— https://p5js.org/
πŸ”— https://processing.org

Original source

3d Ocean

Related Posts

33 Comments

  1. Yanick Rochon
    June 11, 2019 at 18:58

    @TheCodingTrain Daniel, beware that you properly return the expected Promise! At 4:50, your async function returns NOTHING, but the code executes anyway because the function does return a Promise internally. The issue you'd have is that the delay function gets's called, but if you expect to pass down a return value from the delay function, you would've lose that value, here. Unless the behavior is documented, you should return a value inside a promise chain.

    It is also important to note that promises are also recursive (DFS)! And you can still chain a promise AFTER a catch handler.

  2. Look Alike
    June 11, 2019 at 18:58

    How many active timers can a Javascript program have? What if you need more than one? Btw- your tutorials are excellent!

  3. MikeOnTheBox
    June 11, 2019 at 18:58

    When confusing turns into more confusing… I don't mind the errors over errors as it just creates more confusion. Can you "await" for something that isn't a promise?

  4. dfdfdgg gjhjjh
    June 11, 2019 at 18:58

    "you can't just use 'await' anywhere in your code"…. of course javascript wouldn't allow something to be that easy.

  5. punicApp
    June 11, 2019 at 18:58

    Thank you! Very useful!

  6. JavaScript Mastery
    June 11, 2019 at 18:58

    I really like the way you explain the concepts of async/await in this video!
    I've created a video on my channel teaching async/await on a short real world project, feel free to check it out! πŸ™‚

  7. Dominic H.
    June 11, 2019 at 18:58

    Thx man, you helped a lot!

  8. julian caste
    June 11, 2019 at 18:58

    thank you for teaching to people who dont have money to pay a university you're helping many people like me

  9. Karolina Siwkowska
    June 11, 2019 at 18:58

    <3

  10. Karolina Siwkowska
    June 11, 2019 at 18:58

    I think You are such an amazing person πŸ™‚ <3

  11. Love Ess
    June 11, 2019 at 18:58

    really nice way to teach

  12. ChanyaR Brikl
    June 11, 2019 at 18:58

    i wish u have tutorial on how to write a cypress testing cuz there was not much out there and i really like the way u explain things~ Thx for good vdo

  13. giuseppe d
    June 11, 2019 at 18:58

    personally i prefer async() module

  14. Pedro Luiz
    June 11, 2019 at 18:58

    You should be more confident about your work, your videos are awesome!

  15. Marius KΓΌhnast
    June 11, 2019 at 18:58

    Please do a tetris coding challenge.

  16. Sergio MartΓ­n
    June 11, 2019 at 18:58

    How can I "await" an Observable?

  17. Ran Crump
    June 11, 2019 at 18:58

    WE'RE @ ES8 ALREADY?!?!?!?!?!?! I'm not ready xD

  18. Ω© Ω„Ψ§ Ω€Ψ·
    June 11, 2019 at 18:58

    Where you coding?

  19. Scythe
    June 11, 2019 at 18:58

    didn't quite understand async/await by that video. I think the example video will clarify things and I'll hopefully be able to understand then.

  20. Daniel Astillero
    June 11, 2019 at 18:58

    Love this episode, Dan!

  21. DIEGO CARRASCAL
    June 11, 2019 at 18:58

    Too short! hehehehe
    Nice video, I really like the didactic way in which you explain things πŸ™‚

  22. Zombie Brainz
    June 11, 2019 at 18:58

    I find it ironic that the modifier is "async" when what it effectively does is causes promises to operate synchronously… i.e. blocking. Or maybe I'm failing to understand. Keep up the great work!

  23. Isobel Taylor
    June 11, 2019 at 18:58

    You were right, this does seem a lot nicer to me πŸ™‚

  24. kustomweb
    June 11, 2019 at 18:58

    I like this a lot more than a bunch of thens.

  25. Χ Χ“Χ‘ Χ•Χ•Χ™Χ‘
    June 11, 2019 at 18:58

    You gave such a bad example.
    You missed all the benefits of async/await

  26. Ian Chui
    June 11, 2019 at 18:58

    I love coding train

  27. Unknown Aj
    June 11, 2019 at 18:58

    so its looks like Exception ??

  28. Nicholas Brown
    June 11, 2019 at 18:58

    FIRST!!!!

  29. Abdou Ouahib
    June 11, 2019 at 18:58

    ur not boring like other I really like your video ur helpful thanks coding train (:

  30. Robert Tenney
    June 11, 2019 at 18:58

    How about this:
    async delayES8(time) {
    try {
    await delay(time);
    createP('hello');
    } catch (err) {
    console.error(err);
    }
    }
    Embed your .then, .catch into the async function.

  31. Caraxian
    June 11, 2019 at 18:58

    async/await are exactly what I have always wanted. Why didn’t I learn these earlier. Goodbye chains of 50 then

  32. Noman Gul
    June 11, 2019 at 18:58

    Amazing brother!

  33. shadowalker101
    June 11, 2019 at 18:58

    Crikey, not sure whether I should spend the time learning promises or just move straight onto async/await =0

Leave A Comment

You must be logged in to post a comment.