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