34. implement `Promise.any()`

Is this helpful ?

medium  - accepted / - tried

Promise.any() takes an iterable of Promise objects and, as soon as one of the promises in the iterable fulfils, returns a single promise that resolves with the value from that promise

Can you implement a any() to work the same as Promise.any()?


AggregateError is not supported in Chrome yet, but you can still use it in your code since we will add the Class into your code. Do something like following:

new AggregateError(
  'No Promise in Promise.any was resolved', 

Let's try to solve this problem within 10 mintues.