About postfix operators

The postfix operators take one operator and either increment or decrement the operator's value. Although these operators are unary operators, they are classified separately from the rest of the unary operators because of their higher precedence and special behavior. For information on unary operators, see About unary operators.

When you use a postfix operator as part of a larger expression, the expression's value is returned before the postfix operator is processed. For example, the following code shows how the value of the expression xNum++ is returned before the value is incremented.

var xNum:Number = 0;
trace(xNum++); // 0
trace(xNum); // 1

When you trace this code, the text in the Output panel reads:

0
1

The operators in this table have equal precedence:

Operator

Operation performed

++

Increment (postfix)

--

Decrement (postfix)