A: 6
B: 3
C: 13
举一反三
- 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; console.log(t); var t = 3; } test(t); console.log(t); 运行结果是( )? A: 3 3 B: 3 10 C: NaN 10 D: NaN 3
- 分析下段代码输出结果是 var a = 10; function test(a){ a -=3; } test(a); console.log(a);
- vart=10;functiontest(test){t=t+test;console.log(t);vart=3;}test(t);console.log(t);运行结果是()? A: 3 3 B: NaN 10 C: NaN 3 D: 3 10
- 指出代码输出的各个结果: console.log(test); function test(test){ console.log(test); var test=234; console.log(test); function test(){} } test(1); var test=123;
内容
- 0
var a = 10; function test() { console.log(a); var a = 100; console.log(a); } test(); console.log(a);
- 1
如下代码定义了一个类Test: class Test { private int y; Test (int x) { y:x; } }现在为Test 类生成一个对象,正确的语句是( )。 A: Test t = new Test( ); B: Test t=new Test(10, 20); C: Test t; D: Test t=new Test(10);
- 2
查看一下代码 ,请问输出正确的是|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
- 3
假设有类Test,下列可以正确创建对象的语句是( ) A: Test t=1; B: Test t=new Test(); C: Test t=new Test; D: Test t= Test();
- 4
给出如下类定义: public class Test { Test(int i) { } } 如果要创建一个该类的对象,正确的语句是( )。 A: Test t = newTest(); B: Test t = newTest(5); C: Test t = newTest("5"); D: Test t = newTest(3.4);