An operator is a special type of symbols that performing specific types of operations. Like as 5 + 6 * 10 = 65 here is + and * is operators and 5, 6 and 10 is operands.
- Arithmetic Operators
- Assignment Operators
- Comparison Operators
- Logical Operators
- Bitwise Operators
- String Operators
- Conditional (ternary) Operators
|%||modulo (returns the remainder)|
|++||increment (can be prefix or postfix)|
|--||decrement (can be prefix or postfix)|
Assignment operator is used to assign a value to a variable.
|+=||add and assign|
|-+||subtract and assign|
|*=||multiply and assign|
|/=||divide and assign|
|%=||modulo and assign|
A comparison operators compare the operands with comparison operators and return logical value based on comparison is true.
|>=||greater than or equal to|
|<=||less than or equal to|
|===||identical (equal and of same type)|
Logical operators used with boolean values. More than one relation can be logically joined using logical operators.
|<<||shift left (zero fill at right)|
In Bitwise opertators converts operands in 32 bits numbers and work with bit by bit. For example the number of 5 and 6 have the binary represatation of
Using string opertators concatenate the string.
|+=||concatenate and assign|
Conditional (ternary) Operators
The conditional operator creates an expression that evaluates as one of two expressions depending on a condition.
conditions ? value1 : value2