* The function takes an array of promises (assumed non-empty) and returns a promise.
* If any of the passed promises resolve (successfully complete),
then the returned promise resolves with that value.
* If multiple promises are successfully fulfilled,
then the returned promise resolves
* with the first successful value, regardless of the order of promises in the array.
* If all passed promises reject,
then the returned promise rejects with an AggregateError,
which groups all errors, considering the order of promises.
* An AggregateError can be created as follows:
new AggregateError(errors, 'No Promise in any was resolved')
function any(promises) {
// your code here
}