freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../basic-javascript/compound-assignment-with-au.../index.md

343 B

title localeTitle
Compound Assignment With Augmented Subtraction 具有增广减法的复合赋值

具有增广减法的复合赋值

计算机从左到右阅读。因此,使用' - ='运算符意味着变量被右侧的数字减去,然后变量被赋值给差值。像这样:

var b = 10; 
 b -= 4; // Now, 'b' is 6