SOURCE

let promise1 = new Promise((resolve, reject) => {
    setTimeout(()=>{
        resolve(1);    
    },2000)
});
let promise2 = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve(2);    
    },1000)
});
let promise3 = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve(3);    
    },3000)
})
Promise.race([promise1, promise2, promise3]).then(res=>{
    console.log(res);	//2
}, rej => {
    console.log(rej);
})
console 命令行工具 X clear

                    
>
console