const multi ={
num:10,
twonum(){
console.log(this.num*2)
},
threenum:()=>{
console.log(this.num*3)
}
}
multi.twonum()
multi.threenum()
A: 20 and 30
B: 20 and NaN ✔
C: NaN and 30
* twonum 是普通函数 threenum 是箭头函数
* 对于箭头函数, this关键字指向是它所在上下文(就是定义时的位置)的环境
当我们调用threenum 时, 它不是指向 multi 对象
而指的是定义时的环境(window),没有 num 属性
* 普通函数的this就是指向它的直接调用者 shape