Increment & Decrement Operators - Part 3

Notes:

Increment & Decrement Operators in ActionScript - Part 3:

Increment and Decrement Operators:
are used to increment or decrement a variable value by 1.

++ : Increment Operator : is used to increment a variable value by 1
Post Increment : variableName ++
Pre Increment : ++ variableName

-- : Decrement Operator : is used to decrement a variable value by 1
Post Decrement: variableName --
Pre Decrement : -- variableName

Example Code 3:

var a:int=10;
trace("a=",a); //a=10
trace("a=",a++); //a=10
trace("a=",a); //a=11

var a:int=10;
trace("a=",a); //a=10
trace("a=",++a); //a=11
trace("a=",a); //a=11

var a:int=10;
trace("a=",a); //a=10
trace("a=",a--); //a=10
trace("a=",a); //a=9

var a:int=10;
trace("a=",a); //a=10
trace("a=",--a); //a=9
trace("a=",a); //a=9