Palash Mondal
Code with Palash

Code with Palash

Using Promise.any() in JavaScript

Using Promise.any() in JavaScript

Palash Mondal's photo
Palash Mondal
·Feb 20, 2021·

1 min read

Featured on
Play this article

In this video, I'll discuss

  • What is Promise.any() method?
  • Syntax
  • What parameters does this method accept?
  • What does it return?
  • and finally What is the main difference between Promise.any() & Promise.race() methods?

I am going to explain all of these points using lots of examples so that you can clearly understand it and then maybe you can start using it in your own projects based on your use cases.


Promise.any() takes an iterable of Promise objects and, as soon as one of the promises in the iterable fulfills, returns a single promise that resolves with the value from that promise. This method is useful for returning the first promise that fulfills.




iterable - an iterable object, such as an Array.

Please check out this video where all the points are explained in full details:

Wrap Up

I hope you will find this video useful and learn something new in the process. If you want to learn more HTML, CSS, JavaScript and web development tips & tricks, please make sure to subscribe on YouTube!

Share this