Monday, January 7, 2013

Postfix operators

The postfix operators take one operator and either increment or decrement the 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. When a postfix operator is used 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++); // Output: 0
trace (xNum); // Output: 1
All of the operators in this table have equal precedence.

Operator Operation performed
++ Increment (postfix)
-- Decrement (postfix)

0 komentar:

Post a Comment

Programming Actionscript 3. Powered by Blogger.