Apr 09: JavaScript Promises
Learning Objectives
After today’s class, you should be able to:
- Describe how Promises help manage asynchronous operations.
- Create a Promise to run a long-running function asynchronously.
- Explain how to use the keywords
asyncandawaitin JavaScript.
Lesson Outline
Lecture [20 min]
- Chapter 10: Slides 31–36
- Promise – MDN Reference
- How async and await work
- PromisesPrimes.pdf: courtesy of Dr. Kirkpatrick
Example [10 min]
Activity [45 min]
- Project claims (3 min per team)
- Play Fetch: Parts 1–2 last tie, Part 3 today
- Note: Don’t worry about GitHub Classroom
- Clone play-fetch or click “Use this template”