JavaScript » Arithmetic » -

This is the standard subtraction operator and it subtracts one number from another.

This is also the unary negation operator which precedes and negates its operand.

Examples

Code:
x = a - 6;
Explanation:

a minus 6 is assigned to the variable x.

Code:
x = -a;
Explanation:

In this example with 'a' being 6, the value -6 is assigned to the variable 'x' while 'a' retains the value 6.