javascript 算术运算符

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 算术运算符相关的知识,希望对你有一定的参考价值。

/* Arithmetic Operators

Here, y = 5;

+    Addition       (x = y + 2 => 7)

-    Subtraction    (x = y - 2 => 3)

*    Multiplication (x = y * 2 => 10)

/    Division       (x = y / 2 => 2.5)

%    Modulus (remainder)   (x = y % 2 => 1)     

++   Increment      (x = ++y => y = 6 | x = 6)
                    (x = y++ => y = 6 | x = 5)
                    
--   Decrement      (x = --y  => y = 4, x = 4)
                    (x = y--  => y = 4, x = 5)
                    
*/

以上是关于javascript 算术运算符的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript 运算符

javascript 算术运算符

JavaScript运算符

JavaScript运算符

JavaScript运算符

JavaScript日常学习6