单项选择题
async function f(){await Promise.reject(’出错了’);await Promise.resolve(’hello world’);}针对函数式说法正确的是()
A.await Promise.reject(’出错了’);此语句不会执行
B.await Promise.resolve(’hello world’);语句不会执行
C.整个代码执行报错
D.整个代码都不会执行
点击查看答案
相关考题
-
单项选择题
async function f() { return await 123;}f().then(v => console.log(v))打印结果是()
A.123
B.undefined
C.空
D.报错 -
单项选择题
async function testAsync1() { console.log(“hello async”);}let result1 = testAsync1();console.log(result1); ()
A.Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "hello async"}
B.hello async
C.hello asyncPromise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: undefined}
D.报错 -
单项选择题
async function testAsync() { return "hello async";}let result = testAsync();console.log(result)输出结果是()
A.Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "hello async"} ;
B.hello async
C.hello asyncPromise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: undefined}
D.报错
