JavaScript Promises In 10 Minutes

46
3



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:

Twitter:

GitHub:

CodePen:

#JavaScript #Promises #WebDevelopment

Nguồn: https://alimentproteine.com/

Xem thêm bài viết khác: https://alimentproteine.com/cong-nghe/

46 COMMENTS

  1. Thank you for getting straight to the point. Im glad you used only the resources needed for learning this topic. Well done.

  2. I myself do not really understand English, and before this video I watched a lot of videos in Russian on the subject of Promises but I didn’t understand anything, but from your video everything is clear to the last detail! I'm surprised thank you

  3. Thank you so much for this tutorial, I will reccomend this to my friends, love the Promise.all example, really helped me out making a bitcoin return on investment calculator with AJAX JSON and Promises!

  4. Check out this quick 2min read on the States and Fates of Promises. I find its terminology really clear,
    https://github.com/domenic/promises-unwrapping/blob/master/docs/states-and-fates.md

  5. I noticed that you included the () on the arrow function when could have left then off like this….
    then(collection => console.log(collection));

  6. I have a really dumb question. How do you run your JavaScript file in the Chrome console? I can see the 'index.html' part shown at the top, and I guess it's like a localhost thing, but in general what's the standard way of running JavaScript files and seeing the output in the Console?

  7. You are an excellent teacher. And %99.9 of people can't explain how to make toast in a simple manner either

  8. effin hate javascript. everything's confusing af billions of keywords with no explanation whether its a keyword or custom object/function, passing functions into functions, callback hell.
    multithreading in c makes more sense than async js… lol the synthax in js is just soo bloated and all over the place with no consistency. i can get by in any programming language just by using common patterns/coding practices and looking at documentation, with js it feels like after reading documentation i have try the stuff billions of times till i get it working how it's supposed to.
    thank you for the clear explanation, sorry for the rant.

  9. you need to demo an asynchronous call, the promises you used always resolve immediately, they're seemingly indistinct from normal functions. where is the blocking behavior, how does it work?

  10. For developers out there getting started and wanting to test their scripts in the easiest way, look for QUOKKA.JS.

LEAVE A REPLY

Please enter your comment!
Please enter your name here