|
|
Tutorials » Javascript »
|
Topic |
Operator types in Javascript?
|
|
Explanation |
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:
There a three type of operators based on operands used, namely unary, binary, ternary.
Unary - This works with one operand (e.g: a++, a will be incremented by 1),
Binary - This works with two operands (e.g: a+b),
Ternary - This works with three operands (e.g: condition? value 1 : value 2).
There a four type of operators based on the type of use.
Arithmetic Operator
Logical Operator
Comparison Operator
Assignment Operator
|
| A Note |
Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script.
Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.
|
|
|
|