bricks/bricks/myoperator.js
2024-11-20 13:43:23 +08:00

14 lines
210 B
JavaScript

class Oper {
constructor(v){
this.value = v;
}
__plus__(a, b){
console.log(a, b);
return new Oper(a.value + b.value);
}
__add__(a, b){
console.log(a, b);
return new Oper(a.value + b.value);
}
}