JavaScript operators are symbols that are used to perform operations on operands. For example:
Here, + is the arithmetic operator and = is the assignment operator.
There are following types of operators in JavaScript.
- Arithmetic Operators
- Comparison (Relational) Operators
- Bitwise Operators
- Logical Operators
- Assignment Operators
- Special Operators
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic operations on the operands. The following operators are known as JavaScript arithmetic operators.
Operator | Description | Example |
---|---|---|
+ | Addition | 10+20 = 30 |
- | Subtraction | 20-10 = 10 |
* | Multiplication | 10*20 = 200 |
/ | Division | 20/10 = 2 |
% | Modulus (Remainder) | 20%10 = 0 |
++ | Increment | var a=10; a++; Now a = 11 |
-- | Decrement | var a=10; a--; Now a = 9 |
0 Comments