const print = s => console.log(s)
class LWH {
constructor(name, love_person, activity) {
this.name = name
this.love_person = love_person
this.activity = activity
}
getLovedPersonName() {
return this.love_person
}
getActivity() {
return this.activity
}
describe() {
return `我是${this.name},我喜欢${this.love_person},我${this.activity}了`;
}
}
let lwh = new LWH('lwh', 'cmjj', '看痴梦姐姐唱歌')
print(lwh.getLovedPersonName())
print(lwh.getActivity())
print(lwh.describe())
自己看看输出结果吧