This I 'Promise' You!

18:37
 
שתפו
 

Manage episode 287084889 series 2792805
על ידי Andrew Ly & Jason Yata, Andrew Ly, and Jason Yata התגלה על ידי Player FM והקהילה שלנו - זכויות היוצרים שמורות למפרסם, לא ל-Player FM, והשמע מוזרם ישירות מהשרתים שלכם. הירשמו כדי לעקוב אחר עדכונים ב-Player FM, או הדביקו את כתובת העדכונים באפליקציות פודקאסט אחרות.

Today we talk about asynchronous operations in 'Promises', in addition to async and await.
A JavaScript Promise object be in one of four states:

  • Pending - While a Promise object is "pending" (working), the result is undefined.
  • Fulfilled - When a Promise object is "fulfilled", the result is a value.
  • Rejected - When a Promise object is "rejected", the result is an error object.
  • Settled - While a Promise object has been "settled", the result is a value or error object.

The Promise object supports two properties: state and result.

The keyword await before a function makes the function wait for a promise, while the keyword async before a function makes the function return a promise. The async and await make promises easier to write.

References:

Connect With Us!
Instagram: @badforeducationpodcast
Twitter: @badforedupod
Email: badforeducationpodcast@gmail.com
Send us questions! Or say hello to us via email!

Want a free $20 Amazon gift card and to start your own podcast with Buzzsprout?
It's as simple as one click in our link below. Get started today, and have access to their extensive network and assistance. Podcasting isn't hard when you have the right partners!
Click our link here

37 פרקים