标签:console 箭头函数 str class tor nim ima cto OLE
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
标签:console 箭头函数 str class tor nim ima cto OLE
原文地址:https://www.cnblogs.com/hk121929/p/10197994.html