Q1. Why do you need a promise?
Promises are **used to handle asynchronous operations**, especially in languages like JavaScript, which often work with non-blocking operations such as network requests, ...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (13 available).
Promises are **used to handle asynchronous operations**, especially in languages like JavaScript, which often work with non-blocking operations such as network requests, ...
Promises have three states: 1. **Pending:** This is an initial state of the Promise before an operation begins 2. **Fulfilled:** This state indicates that the specified o...
The process of executing a sequence of asynchronous tasks one after another using promises is known as Promise chaining. Let's take an example of promise chaining for cal...
`Promise.all()` is a built-in JavaScript method used to handle multiple asynchronous operations together. It accepts an iterable of promises (usually an array) and return...
No. `Promise.all()` does not cancel the other promises. It only waits for all of them to finish, and if any one rejects, the overall `Promise.all()` call rejects immediat...
Below are the list of pros and cons of promises over callbacks, **Pros:** 1. It avoids callback hell which is unreadable 2. Easy to write sequential asynchronous code wit...
The dynamic imports using `import()` function syntax allows us to load modules on demand by using promises or the async/await syntax. Currently this feature is in [stage4...
Below are the list of different ways to deal with Asynchronous code. 1. Callbacks 2. Promises 3. Async/await 4. Third-party libraries such as async.js,bluebird etc
Until a few days back, One shortcoming of native promises is no direct way to cancel a fetch request. But the new `AbortController` from js specification allows you to us...
Some of the major difference in a tabular form | Promises | Observables | | ------------------------------------------------------------------ | -------------------------...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.