7) 条件(三元)运算符(Conditional operator [kənˈdɪʃənəl) 8) 逗号运算符(Comma operator [ˈkɑ:mə]) 9) 一元运算符(Unary operators [ˈju:nəri]) 10) 关系运算符(Relational operator [rɪ'leɪʃənl]) 1. 赋值运算符(Assignment operators) 一个赋值运算符将它右...
TheAddition Assignment Operator(+=) adds a value to a variable. Assignment letx =10; x +=5; Try it Yourself » OperatorExampleSame As =x = yx = y +=x += yx = x + y -=x -= yx = x - y *=x *= yx = x * y
7) 条件(三元)运算符(Conditional operator [kənˈdɪʃənəl) 8) 逗号运算符(Comma operator [ˈkɑ:mə]) 9) 一元运算符(Unary operators [ˈju:nəri]) 10) 关系运算符(Relational operator [rɪ'leɪʃənl]) 1. 赋值运算符(Assignment operators) 一个赋值运算符将它右...
8. Addition, Subtraction:+ - WWW.dayanit.cn 9. Bitwise Shift:<< >> >>> 10. Relational Operators:< > <= >= instanceof 11. Equality Operators:== != === !== 12. Bitwise AND:& 13. Bitwise XOR:^ 14. Bitwise OR:| 15. Logical AND:&& 16. Logical OR:|| 17. Conditional Operato...
The += Operator TheAddition Assignment Operatoradds a value to a variable. Addition Assignment Examples letx =10; x +=5; Try it Yourself » lettext ="Hello"; text +=" World"; Try it Yourself » The -= Operator TheSubtraction Assignment Operatorsubtracts a value from a variable. ...
Shorthand operator Meaning Assignment x = y x = y Addition assignment x += y x = x + y Subtraction assignment x -= y x = x - y Multiplication assignment x *= y x = x * y Division assignment x /= y x = x / y Remainder assignment ...
复合赋值 Compound Assignment +=,-=,*=,`/=`` +=称为“addition assignment operator。 还可以使用+=运算符来拼接字符串到现有字符串变量的结尾。 let myVar = 1; myVar += 5; myVar -= 1; myVar *= 1; myVar /= 1; let myStr = "This is the first sentence."; ...
加法运算符(Addition):x + y 减法运算符(Subtraction):x - y 乘法运算符(Multiplication):x * y 除法运算符(Division):x / y 余数运算符(Remainder):x % y 自增运算符(Increment):++x或者x++ 自减运算符(Decrement):--x或者x-- 数值运算符(Convert to number):+x 负数值运算符(Negate):-x ...
OperatorNameExample = Assignment Operator a = 7; += Addition Assignment a += 5; // a = a + 5 -= Subtraction Assignment a -= 2; // a = a - 2 *= Multiplication Assignment a *= 3; // a = a * 3 /= Division Assignment a /= 2; // a = a / 2 %= Remainder Assignment ...
八、Compound Assignment with Augmented Addition用扩增法赋综合值 a = a + 12 可写作 a += 12 九、Compound Assignment with Augmented Subtraction用扩减法赋综合值 a = a - 12 可写作 a -= 12 十、Compound Assignment with Augmented Multiplication用扩乘法赋综合值 ...