复制1const myPromise = Promise.resolve("Woah some cool data"); 2 3(async () => { 4 try { 5 console.log(await myPromise); 6 } catch { 7 throw new Error(`Oops didn't work`); 8 } finally { 9 console.log("Oh finally!"); 10 } 11})();
1const myPromise = Promise.resolve("Woah some cool data"); 2 3(async () => { 4 try { 5 console.log(await myPromise); 6 } catch { 7 throw new Error(`Oops didn't work`); 8 } finally { 9 console.log("Oh finally!"); 10 } 11})();
本题为“单选题”
题库维护不易,您的支持就是我们最大的动力!