Unary + and - Operators

Definition

The unary + and - operators each take a single operand.

  • The + operator has no effect on its operand.

  • The - operator negates its operand.

Examples

x = -5 // assigns negative five to x
x = +5 // assigns five to x