Operator:
An operator is a symbol or sign used in javascript to identify a specific operation.
For example, when we want to define an expression for adding two numbers, we use 3+4.
Here let us assume that we have defined variable a and b for the number, so the expression
will become a+b;
The symbol "+" defines that the operands a and b has to be added. So "+" is called as
an operator.
Types Of Operators:
There a three type of operators based on operands used, namely unary, binary, ternary.
Unary - The Operator works with one operand (e.g: a++, a will be incremented by 1),
Binary - The Operator works with two operands (e.g: a+b),
Ternary - The Operator works with three operands (e.g: condition? value 1 : value 2).
There a four type of operators based on the type of use.
|