JavaScript Operator
JavaScript
contains long list of the operator which are given in the following table.
JavaScript supports the following types of the operator.
1. Arithmetic Operator
2. Logical Operator
3. Assignment Operator
4. Comparison Operator
5. Conditional Operator
6. BitWise Operator
7. Special Operator
Let
Suppose, a=b+c is an expression
Where a= Resultant operand
b=left
side operand
+=Addition
operator
c=right
side operand
1. Arithmetic Operator
Ex
: + , - , * , / , % , ++ , --
2. Logical Operator
Ex
: && , || , !
3. Assignment Operator
Ex
: = , +=, -=, *=, /= ,%=
4. Comparison Operator
Ex
: == , != , > , < , >= , <= , === , !==
5. Conditional Operator
Ex
: ?:
6. Bit Wise Operator
Ex
: & , | , ^ , ~ , << , >> , >>>
6. Special Operator
Ex
: new , delete , instanceof, typeof
List of JavaScript Operator
Sr. | Operator Name | Operator Symbol | Function |
---|---|---|---|
1. | Addition | + | Addition Operations and String Concatenation |
2. | Append | += | Mathematical Shorthand Operator and Append The Variable data String |
3. | Assignment | = | Assign The New value of Left Operand is Equal To Right Operand |
4. | Comma | , | To Pass The Multiple Argument in Function , Array |
5. | decrement | -- | decrease a Number by 1 |
6. | delete | delete | To delete The objects |
7. | division | / | Divide Two Numbers |
8. | Equal | == | Compare The value of the Left and Right Side Operand |
9. | Greater Than | > | Check Left Operand is Greater Than To Right Operand |
10. | Greater Than or Equal | >= | Check Left Operand is Greater Than or Equal To Right Operand |
11. | In | in | it Checks That Instance is the Property of the proper object or not |
12. | Increment | ++ | Used To increment The number by 1 |
13. | Instanceof | instanceof | Checks that left Side operands Matches with the data type of right side operand |
14. | Less Than | < | Check Left Operand is Less Than To Right Operand |
15. | Less Than or Equal | <= | Check Left Operand is Less Than or Equal To Right Operand |
16. | Logical AND | && | evaluate Left and Right Side Operand both value is true or not |
17. | Logical NOT | ! | it Will Return true if operand is Empty Otherwise false |
18. | Logical OR | || | evaluate Left and Right Side Operand Any One value is true or not |
19. | Modulus | % | Evaluate remainder of the two left and right side Operand . |
20. | Multiplication | * | Multiply of Two Number |
21. | New | new | Define The new instance of the object Which We created |
22. | Not Equal | != | Check That Operand on Left side is not equal to the right side Operand. |
23. | Strict Equal | === | Similar To The Equal Operator but it also evaluate the data type also . |
24. | Strict Not | !== | Similar To The Not Equal Operator but it also evaluate the data type also . |
25. | Subtraction | - | Subtraction of two Number |
26. | Ternary | (expression) ? "output if expression is true" : "output if expression is false" | Sort Form of the Conditional Statement |
27. | This | this | Dynamically Access The object Property |
28. | Typeof | typeof | return the data type of an object |
29. | void | void | it will gives no return value |
typeof Operator
typeof operator return the data type of an Object. Following is the list of return
value of the typeof Operator.
Sr. | Data Type | Return Value |
---|---|---|
1. | Null | object |
2. | Undefined | undefined |
3. | Number | number |
4. | String | string |
5. | Boolean | boolean |
6. | Object | object |
7. | Function | function |
Shorthand Operator
Ex : a+=b
Means a=a+b
Sr. | Shorthand Operator | Meaning |
---|---|---|
1. | a+=b | a=a+b |
2. | a-=b | a=a-b |
3. | a*=b | a=a*b |
4. | a/=b | a=a/b |
5. | a%=b | a=a%b |
6. | a<<=b | a=a< |
7. | a>>=b | a=a>>b |
8. | a>>>=b | a=a>>>b |
9. | a&=b | a=a&b |
10. | a^=b | a=a^b |
11. | a|=b | a=a|b |
Thank you to all my reader
Related Post
5. JDK 8