在 JavaScript 中,-- 运算符可以用来递减一个变量的值。例如,this.currentMale-- 会将 this.currentMale 的值减 1。

this.currentMale--;

这个代码等效于:

this.currentMale = this.currentMale - 1;

注意,-- 运算符放在变量的后面,表示先使用变量的值,然后再递减。


原文地址: https://www.cveoy.top/t/topic/ot14 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录