+ Promise.any ( _iterable_ )
+ The `any` function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
+
+ 1. Let _C_ be the *this* value.
+ 1. If Type(_C_) is not Object, throw a *TypeError* exception.
+ 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
+ 1. Let _iteratorRecord_ be GetIterator(_iterable_).
+ 1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_).
+ 1. Let _result_ be PerformPromiseAny(_iteratorRecord_, _C_, _promiseCapability_).
+ 1. If _result_ is an abrupt completion, then
+ 1. If _iteratorRecord_.[[Done]] is *false*, set _result_ to IteratorClose(_iteratorRecord_, _result_).
+ 1. IfAbruptRejectPromise(_result_, _promiseCapability_).
+ 1. Return Completion(_result_).
+
+
+ The `any` function requires its *this* value to be a constructor function that supports the parameter conventions of the `Promise` constructor.
+
+
+
+ Runtime Semantics: PerformPromiseAny ( _iteratorRecord_, _constructor_, _resultCapability_ )
+ When the PerformPromiseAny abstract operation is called with arguments _iteratorRecord_, _constructor_, and _resultCapability_, the following steps are taken:
+
+ 1. Assert: ! IsConstructor(_constructor_) is *true*.
+ 1. Assert: _resultCapability_ is a PromiseCapability Record.
+ 1. Let _values_ be a new empty List.
+ 1. Let _remainingElementsCount_ be a new Record { [[Value]]: 1 }.
+ 1. Let _index_ be 0.
+ 1. Repeat,
+ 1. Let _next_ be IteratorStep(_iteratorRecord_).
+ 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
+ 1. ReturnIfAbrupt(_next_).
+ 1. If _next_ is *false*, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
+ 1. If _remainingElementsCount_.[[Value]] is 0, then
+ 1. Let _valuesArray_ be CreateArrayFromList(_values_).
+ 1. Perform ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »).
+ 1. Return _resultCapability_.[[Promise]].
+ 1. Let _nextValue_ be IteratorValue(_next_).
+ 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
+ 1. ReturnIfAbrupt(_nextValue_).
+ 1. Append *undefined* to _values_.
+ 1. Let _nextPromise_ be ? Invoke(_constructor_, `"resolve"`, « _nextValue_ »).
+ 1. Let _steps_ be the algorithm steps defined in .
+ 1. Let _rejectElement_ be CreateBuiltinFunction(_steps_, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
+ 1. Set _rejectElement_.[[AlreadyCalled]] to a new Record { [[Value]]: *false* }.
+ 1. Set _rejectElement_.[[Index]] to _index_.
+ 1. Set _rejectElement_.[[Values]] to _values_.
+ 1. Set _rejectElement_.[[Capability]] to _resultCapability_.
+ 1. Set _rejectElement_.[[RemainingElements]] to _remainingElementsCount_.
+ 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] + 1.
+ 1. Perform ? Invoke(_nextPromise_, `"then"`, « _resultCapability_, _rejectElement_[[Reject]] »).
+ 1. Increase _index_ by 1.
+
+
+
+
+ `Promise.any` Reject Element Functions
+ A `Promise.any` reject element function is an anonymous built-in function that is used to reject a specific `Promise.any` element. Each `Promise.any` reject element function has [[Index]], [[Values]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.
+ When a `Promise.any` reject element function is called with argument _x_, the following steps are taken:
+
+ 1. Let _F_ be the active function object.
+ 1. Let _alreadyCalled_ be _F_.[[AlreadyCalled]].
+ 1. If _alreadyCalled_.[[Value]] is *true*, return *undefined*.
+ 1. Set _alreadyCalled_.[[Value]] to *true*.
+ 1. Let _index_ be _F_.[[Index]].
+ 1. Let _values_ be _F_.[[Values]].
+ 1. Let _promiseCapability_ be _F_.[[Capability]].
+ 1. Let _remainingElementsCount_ be _F_.[[RemainingElements]].
+ 1. Set _values_[_index_] to _x_.
+ 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
+ 1. If _remainingElementsCount_.[[Value]] is 0, then
+ 1. Let _valuesArray_ be CreateArrayFromList(_values_).
+ 1. Return ? Call(*undefined*, _promiseCapability_.[[Reject]], « _valuesArray_ »).
+ 1. Return *undefined*.
+
+ The `"length"` property of a `Promise.any` resolve element function is 1.
+
+