JavaScript includes operators as in other languages. An operator performs some operation on single or multiple operands (data value) and produces a result. For example 1 + 2, where + sign is an operator and 1 is left operand and 2 is right operand. + operator adds two numeric values and produces a result which is 3 in this case.
JavaScript includes following categories of operators.
The +
operator can also be used to add (concatenate) strings.
var
txt1 = "John";
var
txt2 = "Doe";
var
txt3 = txt1 + " " + txt2;