• 2022-06-15
    分析下段代码输出结果是 var a = 10; function test(a){ a -=3; } test(a); console.log(a);
  • 10

    内容

    • 0

      查看一下代码 ,请问输出正确的是|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

    • 1

      分析下段代码输出结果是vara=10;functiontest(a){a-=3;}test(a);console.log(a); A: 7 B: 10 C: 13 D: NaN

    • 2

      查看如下代码:function test(a) {a = a + 10;}var a = 10;test(a);console.log(a);上述代码执行后,输出变量a的值为()。 A: 10 B: 20 C: 错误 D: undefined

    • 3

      以下代码执行后,输出结果为100。$var=100;function test( ){ echo $var;}test( );

    • 4

      下面的JavaScript代码,执行后输出结果是( )var a = 1000;b = 2014;function test( ){ b = 2000;}test( );console.log(a+b); A: 3014 B: 1000undefined C: 1000 D: 3000