指出代码输出的各个结果: console.log(test); function test(test){ console.log(test); var test=234; console.log(test); function test(){} } test(1); var test=123;
举一反三
- 查看一下代码 ,请问输出正确的是|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
- var a = 10; function test() { console.log(a); var a = 100; console.log(a); } test(); console.log(a);
- 分析下段代码输出结果是 var a = 10; function test(a){ a -=3; } test(a); console.log(a);
- 145.var t = 10; function test(test){ t = t + test; console.log(t); var t = 3; } test(t); console.log(t); 运行结果是( )?
- 分析下段代码输出结果是 var t = 10;function test(test){ t = t + test; var t = 3; console.log(t); } test(t); A: 6 B: 3 C: 13