单项选择题
有关回调地狱的说法错的是()
A.当一个函数需要依赖上一个回调函数的值的时候,就存在回调函数嵌套,如果痛传统的回调函数处理就会产生地狱回调问题
B.Promise回调函数采用的链式操作,代码纵向发展
C.async机制的出现并不能解决回调地狱的问题,没什么用处
点击查看答案
相关考题
-
单项选择题
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.报错
