fn2.num为啥打印的是111,f1中的this经过call指向了f2,为啥去打印f1的num?functionfn1(){console.log(1);this.num=111;this.sayHey=function(){console.log("sayhey.");}}functionfn2(){console.log(2);this.num=222;this.sayHello=function(){console.log("sayhello.");}}fn1.call(fn2);console.log(fn2.num);//111
大话西游666
相关分类