Chuyên mục
Internet

JavaScript Promises In 10 Minutes

Rate this post



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

Tag: promise in javascript, webdevsimplified, javascript promises, javascript promises tutorial, javascript promises for beginners, javascript promises explained, javascript promises explained tutorial, javascript promises es6, javascript promises examples, javascript es6 promises tutorial, how to use javascript promises, promises tutorial, promises tutorial javascript, promises explained, promises explained javascript, js promises, js promises explained, js promises tutorial, js, promises

Xem thêm: https://meohay360.com/category/internet

Nguồn: https://meohay360.com

30 trả lời trong “JavaScript Promises In 10 Minutes”

There is something misleading in the Promise.race scenario. The first promise isn't the first to complete because it is so simple, it is the first to complete because all the code executing is synchronous, therefore the first to complete is the first in the Promise.race call. No matter how complicated the first promise call is, it would always be first. I have seen many developers mistake the Promise object for creating async behaviour, when in reality a Promise only behaves asynchronous if the code inside the promise is doing something async.

Hi Kyle! First of all, I'm new to the channel and I very much like the way and the speed at which you explain concepts in your videos. I have one question regarding Promise.all([promiseOne, promiseTwo…]) syntax. Does it always resolve in the same order you passed promises in or does it depend on something else?

Trả lời

Email của bạn sẽ không được hiển thị công khai.