class的基本使用
人艰不拆的class
class和普通构造函数的区别
基本语法
class MathHandle{
//构造器
constructor(x,y){
this.x = x;
this.y = y;
}
add(){
return this.x+this.y
}
}
const m = new MathHandle(1,2)
console.log(m.add())语法糖
最后更新于