What are operators

The operator is usually a symbol that is used when we want to perform some standard, frequently used operation, such as assignment of values, comparison of values, arithmetic operations…
Operators can be understood as special functions which, unlike “ordinary functions”, are written in a “non-standard way”. Operators use the so-called “infix” notation (the function name is placed between two parameters). The standard operator shown with “infix” notation looks like this:
... operator...
The following example shows that there is an essential similarity between the operator and the function:
|
1 2 3 4 |
function plus (a, b) { return a+b; } plus(3,4); // Returns7 |
The most common are binary operators (operators that take two values as input), although there are also unary operators that perform certain operations on only one value:
|
1 2 3 |
var brojac = 0; brojac++; console.log(brojac); // Returns: 1 |




