Operators apply simple operations such as addition and multiplication to operands such as numbers. They usually return a new value that is the result of the operation.
Most operators are binary, meaning that they work on two operands, as shown in the following pseudocode:
var resultOfOperation = firstOperand operator secondOperand;
Some operators are unary, meaning they work on a single operand, as shown in the following pseudocode:
var resultOfOperation = onlyOperand operator;
A ternary operator works on three operands, as shown in the following pseudocode:
var resultOfOperation =
firstOperand firstOperator secondOperand secondOperator thirdOperand;