var person = {
name:"mapinx".age:18.getAgeA:() = >{
console.log(this.age);
},
getAgeB:function(){
console.log(this.age);
},
show:function(){
let fn =() = >{
console.log(this.age); }}}//=> havenot spuer,new.target,arguments,this.
person.getAgeA();//undefined
person.getAgeB();/ / 18
person.show();/ / 18
Copy the code
This refers to: 1. In global mode: refers to Window 2. In function body, in non-strict mode: refers to window; Strictly referring to undefined 3, object refers to this object. Object method in the function body pointing in the direction of the window. The arrow function: no spuer, new. Target, this and the arguments. Non-constructor.