asyncfunctiontestAsync1(){console.log(“helloasync”);}letresult1=testAsync1();console.log(result1);()
A: Promise{[[PromiseStatus]]:"resolved",[[PromiseValue]]:"helloasync"}
B: helloasync
C: helloasyncPromise{[[PromiseStatus]]:"resolved",[[PromiseValue]]:undefined}
D: 报错
A: Promise{[[PromiseStatus]]:"resolved",[[PromiseValue]]:"helloasync"}
B: helloasync
C: helloasyncPromise{[[PromiseStatus]]:"resolved",[[PromiseValue]]:undefined}
D: 报错
举一反三
- const{log}=console;log(’hello’)执行这个代码在控制台的结果是什么?() A: hello B: 报错 C: undefined D:
- 在javascript中,以下代码执行的结果是: function test1(){ return console.log(1) } function test2(){ return 0 } console.log(test1()); console.log(test2()); A: 1,undefined,0 B: 1,0 C: null,0 D: 报错
- 以下代码的运行结果是()。var a = '1';var a, b;console.log(a, b); A: undefined undefined B: null undefined C: 1 1 D: 1 undefined
- 下列代码输出的结果是 var y = 1; var x = y = typeof x; console.log(x); A: undefined B: 1 C: y D: 报错
- 在javascript中,以下代码执行的结果是( ) function test1(){ return console.log(1) } function test2(){ return 0 } console.log(test1()); console.log(test2()); A: undefined,0 B: 1,0 C: null,0 D: 报错