async-await
Async/await patterns and type behaviors
Understand why TypeScript ignores object property mutations during async operations, maintaining narrowed types like 'pending' post-await. Learn workarounds for TypeScript async mutation, control flow analysis, and best practices for safe object state handling.
Learn when to use Task.Delay vs Thread.Sleep in .NET. Guidelines for async methods, minimum delays, overhead from context-switching, and efficiency in concurrent apps like web APIs and UIs.
Fix Express.js routes returning undefined from Mongoose. Use async/await or .then() with try/catch so res.json sends findById result after promise resolves.
Learn why using async/await inside JavaScript forEach doesn't wait for promises, causing unhandled rejections and early completion. Fix with for...of, Promise.all, Promise.allSettled for sequential, parallel processing.