Promises & then/catch
What is a Promise in JavaScript?
A Promise is a proxy for a value that might not be available immediately. Key characteristics: 1) Represents the eventual completion/failure of an async operation, 2) Has three states: pending, fulfilled, or rejected, 3) Provides a cleaner way to handle asynchronous operations compared to callbacks, 4) Guarantees that callbacks won't be called before the completion of the current run of the JavaScript event loop, 5) Enables better error handling through standardized patterns.