01. Promises/Elaboration

Break Promises
πŸ‘¨β€πŸ’Ό Excellent! You now understand how to create and work with Promises.
You learned:
  • πŸ”¨ Creating Promises with new Promise()
  • πŸ”— Chaining operations with .then()
  • ⚠️ Error handling with .catch()
  • 🎯 Type safety with Promise<T> generic types
πŸ¦‰ Remember: Promises are eagerβ€”they start executing immediately when created. If you need lazy execution, wrap the Promise creation in a function.
// Eager - starts immediately
const promise = fetchData()

// Lazy - starts when function is called
const getPromise = () => fetchData()
Next up: Async/awaitβ€”a cleaner syntax for working with Promises!

Test Your Knowledge

Retrieval practice helps solidify learning by actively recalling information. Use this prompt with your AI assistant to quiz yourself on what you've learned.

Please quiz me on exercise 1 using the epicshop MCP server. Call the get_quiz_instructions tool with exerciseNumber "1" to get the quiz instructions, then quiz me one question at a time.

Learn how to set up the epicshop MCP server

Loading Promises Elaboration form