Bad For Education - Coding Tips For The Junior Developer & Beyond

This I 'Promise' You!


Listen Later

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:

  • Andrew's Blog Article on Promises
  • Another article for Promises
  • Async and Await

Connect With Us!
Instagram: @badforeducationpodcast
Twitter: @badforedupod
Email: [email protected]

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

...more
View all episodesView all episodes
Download on the App Store

Bad For Education - Coding Tips For The Junior Developer & BeyondBy Andrew Ly & Jason Yata