const Person = function(name){
this.name= name;
this.getName = () => {
return this.name;
}
}
let person = new Person('Mark');
person.city = 'New York';
Person.prototype.getCity = () => {
return this.city;
};
console.log(person.getName());
console.log(person.getCity());
标记 未定义
为什么this.city返回undefined?有什么解释吗?