constructor
class Coder {
name(val) {
console.log(val)
return val;
}
skill(val) {
console.log(this.name('wj') + ':' + 'Skill-' + val)
}
// 类的参数
constructor(a, b) {
this.a = a
this.b = b
}
add() {
return this.a + this.b;
}
}
let wj = new Coder(1,2);
console.log(wj.add())