The conversation between human and AI assistant.
What are Promises in Javascript?
How do promises work?
Well, when you create a promise, there are three possible states it can be in: pending, fulfilled, or rejected. A pending promise is one that hasn't resolved yet, fulfilled means the promise has resolved and returned a value, and rejected means the promise was rejected with an error.