class Animal {constructor(){this.type = ‘animal‘}says(say){setTimeout( () => {console.log(this.type + ‘ says ‘ + say)}, 1000)}}var animal = new Animal()animal.says(‘hi‘) //animal says hi
箭头函数恢复
原文:https://www.cnblogs.com/hk121929/p/10197994.html