
- Synchronous vs asynchronous code
- How asynchronous code is executed
- What is the execution thread
- Event loop
- Ajax
- Callback hell
- Promises object methods
- Async and await
- Static and instance Promise methods
- How
response.json() works
- Error handling with try/catch
- Interview questions
Static methods are called directly on the Promise class reference (not on an instance).
| Method |
Description |
Promise.all() |
Takes an array of promises; rejects immediately if any one rejects |
Promise.allSettled() |
Resolves once every promise has settled, regardless of fulfilled/rejected |
Promise.any() |
Resolves with the first fulfilled promise; order not preserved |
Promise.race() |
Settles as soon as the first promise settles (fulfilled or rejected) |
Promise.reject() |
Returns a promise rejected with the given reason |
Promise.resolve() |
Returns a promise resolved with the given value |
Promise.try() |
Runs a function and wraps its result/thrown error in a promise |
Promise.resolvers() |
Returns { promise, resolve, reject } as a convenience object |