Decremental Assignment (-=) Expression Summary Decrement the value of a variable. Syntax variable -= expression Parameters variable The variable, property, or array element to be update. expression Any legal expression. Description For numeric variables, the -= operator computes the value of the expression on the right, and then subtracts it from the variable, property, or array element on the left. The expression on the right is evaluated prior to assignment: 12int x = 2;x -= 3 * x + 5; // x is assigned the value -9 The -= operator is equivalent to the - operator with the left-hand side being the variable, property, or array element to modify and the right-hand side being the expression to subtract. Therefore, the following expressions are equivalent: 12x -= 5; // Equivalent to x = x - 5x = x - 5; // Equivalent to x -= 5 For simply subtracting the value 1 (one), see the decrement expression. Examples Basic Usage 123456import System; int x = 10;Console.log(x); // 10x -= 2;Console.log(x); // 8 See Also Decrement Operation Subtraction Operator Share HTML | BBCode | Direct Link