Suggested answer

A Promise represents the eventual completion or failure of an async operation. States: pending, fulfilled (resolved), rejected. Creating: new Promise((resolve, reject) => { /* async work */ });. Consuming: .then(result => ...) (fulfilled), .catch(err => ...) (rejected), .finally(() => ...) (always). Chaining: each .then() returns a new Promise — the chain is sequential. Promise.all(promises): Waits for all to resolve; rejects immediately if any rejects. Promise.race(promises): Resolves/rejects with the first to settle. Promise.allSettled(promises): Waits for all to settle regardless of outcome — returns array of {status, value/reason} objects. Promise.any(promises): Resolves with the first fulfilled; rejects only if all reject (AggregateError).

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.