可能是一个菜鸟问题,但如何防止减量超过零变成负数?
public counter : number = 0; increment(){ this.counter += 1; } decrement(){ this.counter -= 1; }
javascript
javascript ×1