1const firstPromise = new Promise((res, rej) => { 2 setTimeout(res, 500, "one"); 3}); 4 5const secondPromise = new Promise((res, rej) => { 6 setTimeout(res, 100, "two"); 7}); 8 9Promise.race([firstPromise, secondPromise]).then(res => console.log(res));
本题为“单选题”