标签:this java script class rip str cto his bsp
// 类组件
class Person {
constructor (name,age) {
this.name =name
this.age = age
}
sayHi () {
console.log(this)
}
}
let person = new Person(‘李李‘)
person.sayHi()
关键字:class、constructor
标签:this java script class rip str cto his bsp
原文地址:https://www.cnblogs.com/js-liqian/p/11747761.html