zmhc

关注

react18-学习笔记11-类class

zmhc

关注

阅读 175

2022-08-28

react18-学习笔记11-类class_编程

class Animal{
name: string
constructor (name:string){
this.name=name
}
run(){
return `${this.name}`
}
}
const snake=new Animal("geyao")

class Dog extends Animal{
bark(){
return `${this.name}`
}
}
const dog=new Dog("geyao")



相关推荐

安七月读书

react18-学习笔记12-类class

安七月读书 150 0 0

往复随安_5bb5

react18-学习笔记13-类和接口

往复随安_5bb5 208 0 0

独孤凌雪

react18-学习笔记27-useEffect3

独孤凌雪 198 0 0

无愠色

react18-学习笔记15-泛型

无愠色 195 0 0

分湖芝蘭

react18-学习笔记14-枚举(Enum)

分湖芝蘭 140 0 0

修炼之士

react18-学习笔记25-useEffect1

修炼之士 265 0 0

m逆光生长

react18-学习笔记26-useEffect2

m逆光生长 258 0 0

DYBOY

react18-学习笔记40-normalise.css

DYBOY 105 0 0

其生

react18-学习笔记41-button组件分析

其生 54 0 0

朱小落

react18-学习笔记29-高阶组件hoc

朱小落 131 0 0

精彩评论(0)

0 0 举报