企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
>[success] # 链式调用 ~~~ const func1 = Symbol('func1') export default class Point { static [func1] () { } } class Counters{ constructor(count=0){ this.count = count } add(value){ this.count+=value return this } sub(value){ this.count -=value return this } } let counters = new Counters() counters.add(3).sub(1) console.log(counters.count) class PowCounters extends Counters{ pow (value){ this.count = this.count ** value return this } } let powCounters = new PowCounters(5) powCounters.add(3).sub(1) console.log(powCounters.count) ~~~