同学你好,问题解答如下:
1、题目是outer( ).fn( ),先看outer( )调用:
outer中,通过return关键字返回了一个对象,该对象如下(图一):

所以outer( )调用后,会得到下图中的对象:

2、该对象下的fn属性是个函数,所以outer().fn()--》上图中的对象.fn( ),意思是通过对象点的方式调用fn方法函数。此时this指向就符合课程中:对象.函数名()的规则。如下:

因此fn中的this就指向图一中的对象上, 所以访问的this.a 值为33, this.b值为44, 最终输出结果为77。
祝学习愉快~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星