在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: 报错
A: 1,undefined,0
B: 1,0
C: null,0
D: 报错
A
举一反三
- 在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: 报错
- 在html中嵌入以下代码,在控制台输出的是(): [script] console.log(a); [/] [script] var b = 8; console.log(a); [/] function test1(){ return console.log(1) } [br][/br] function test2(){ [br][/br] return 0 [br][/br] } [br][/br] console.log(test1()); [br][/br] console.log(test2()); A: 报错,报错 B: 报错,8 C: 报错,不输出任何东西 D: a,8
- 指出代码输出的各个结果: console.log(test); function test(test){ console.log(test); var test=234; console.log(test); function test(){} } test(1); var test=123;
- 已知:var test = { x1 : [1, 2, 3, 4, 5], x2 : 'hello', x3 : { y1: false, y2: null, }}以下哪句可以在Console控制台输出y1的值? A: console.log(test.x3.y1) B: console.log(test[0].x3.y1) C: console.log(x3.y1) D: console.log(y1)
- 查看一下代码 ,请问输出正确的是|var Test ={| foo:"test",| func:function () {| var self=this;| console.log(this.foo);| console.log(self.foo);| (function () {| console.log(this.foo);| console.log(self.foo);| })();| }|};|Test.func(); A: test test undefined test B: test undefined undefined test C: test test undefined D: test test test test
内容
- 0
写出以下程序的执行结果为( )function test() {console.log(a);var a = 1;console.log(a);console.log(hello)}tset();
- 1
已知:[img=304x221]17e0b8d928fec91.png[/img]以下哪句可以在Console控制台输出y1的值? A: console.log(test.x3.y1) B: console.log(test[0].x3.y1) C: console.log(x3.y1) D: console.log(y1)
- 2
var x=1;function test(){ console.log(x);var x=19;console.log(x);}console.log(x);test();console.log(x);程序执行完毕,控制台依次打印x的值为:___、____、____、____
- 3
<script> function fun(){ try{ console.log(a); return 0; }catch(e){ console.log(e.message); return 1; }finally{ return 2; } } var b = fun(); console.log(b); </script>b输出结果为:——————
- 4
var a = 10; function test() { console.log(a); var a = 100; console.log(a); } test(); console.log(a);