JavaScript链式调用 // 链式调用 class User { constructor() { this.height = 0 this.weight = 0 } info() { console.log("信息",this.height,this.weight) return this } setHeight(val) { this.height = val return this } } let user = new User() user.info().setHeight(10).info()