Async/await thumbnail
Async/await
javascript.info
The word “async” before a function means one simple thing: a function always returns a promise. For instance, this function returns a resolved promise with the result of 1 Here’s an example with a promise that resolves in 1 second The function execution “pauses” at the line (*) and resumes when the
6 Users
0 Comments
121 Highlights
0 Notes

Top Highlights

  • The word “async” before a function means one simple thing: a function always returns a promise.
  • For instance, this function returns a resolved promise with the result of 1
  • Here’s an example with a promise that resolves in 1 second
  • The function execution “pauses” at the line (*) and resumes when the promise settles
  • The keyword await makes JavaScript wait until that promise settles and returns its result.

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.