Increment & Decrement Operators - Part 1
Notes:
Increment & Decrement Operators in ActionScript - Part 1:
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 code1:
var a:int=10;
trace("a=",a); //a= 10
a++;
trace("a=",a); //a= 11
var a:int=10;
trace("a=",a); //a= 10
++a;
trace("a=",a); //a= 11
var a:int=10;
trace("a=",a); //a= 10
a--;
trace("a=",a); //a= 9
var a:int=10;
trace("a=",a); //a= 10
--a;
trace("a=",a); //a= 9