分析下段代码输出结果是vara=10;functiontest(a){a-=3;}test(a);console.log(a);
A: 7
B: 10
C: 13
D: NaN
A: 7
B: 10
C: 13
D: NaN
举一反三
- 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
- 分析下段代码输出结果是 var a = 10; function test(a){ a -=3; } test(a); console.log(a);
- 分析下段代码输出结果是 var t = 10;function test(test){ t = t + test; var t = 3; console.log(t); } test(t); A: 6 B: 3 C: 13
- 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
- functiontest(){vara=20;alert(a);setTimeout(function(){a=30;alert(a);},2000);alert(10);}test();以上代码的弹出顺序是() A: 20,10,30 B: 20,20,10 C: 20,10,20 D: 20,30,10