5.3.1 Unary Operators

OperatorOperationOperand typePositionResult type
~bitwise negationIntprefixInt
!logical negationBoolprefixBool
-arithmetic negationFloat/Intprefixsame as operand
++incrementFloat/Intprefix and postfixsame as operand
--decrementFloat/Intprefix and postfixsame as operand
Increment and decrement

The increment and decrement operators change the given value, so they cannot be applied to a read-only value. They also produce different results based on whether they are used as a prefix operator, which evaluates to the modified value, or as a postfix operator, which evaluates to the original value:

var a = 10;
trace(a++); // 10
trace(a); // 11

a = 10;
trace(++a); // 11
trace(a); // 11