JS Built-ins
AsyncPatternsintermediate

Promise.any returns Promise

πŸ“– Usage Example
const first = await Promise.any([Promise.reject('no'), Promise.resolve('yes')]);
// 'yes'

Promise.any() resolves with the first fulfilled promise, ignoring rejections.

Promise.any()

Promise.any() returns a Promise that resolves with the first fulfilled Promise.

Challenge: Verify that Promise.any() returns a Promise instance.

πŸ’‘ Hints (2)
  • β€’ Promise.any() always returns a Promise.
  • β€’ It resolves with the first fulfilled Promise.