跳到主要内容

Promise

Promise.race

Promise.race(iterable) 方法返回一个 promise,一旦迭代器中的某个 promise 解决或拒绝,返回的 promise 就会解决或拒绝。也就是说,哪个 promise 先解决,这个"race"就结束了。