下列代码输出的结果是 var y = 1; var x = y = typeof x; console.log(x);
A: undefined
B: 1
C: y
D: 报错
A: undefined
B: 1
C: y
D: 报错
举一反三
- 有下列代码执行后的结果是var x = 10; function f1( num ){ ++ num; } var y = f1( x );console.log( 'x=' + x + '; y=' + y ); A: x=10; y=undefined B: x=10; y=11 C: x=11; y=11 D: x=11; y=undefined
- 阅读下面的JavaScript代码,输出结果是 for(var x=0; x<3; x++){ y=x*x; console.log(y); }
- 阅读下面的JavaScript代码 function f(y) { var x = y * y; return x; } for(var x = 0; x < 5; x ++) { y = f(x); document.writeln(y); } 输出结果是
- 以下代码执行后, num 的值是多少?var foo = function(x, y) {return x - y;};function foo(x, y) {return x + y;}var num = foo(1, 2);console.log(num);
- 下列代码的运行结果是______ <script> var x = 1; function test() { var x = 2; y = 3; document.write(x); } test(); document.write(x); document.write(y); </script>