The Postfix Operator Group
The Post Increment Operator ( ++ )
The Post Decrement Operator ( -- )



Navigation Aids -- This Page        Navigation Aids -- This Topic        Navigation Aids -- This Site








Review of Terms Related to This Topic





The Purpose for this Page

This page will show the basic rules for the JavaScript postfix operator group. Some special situation cases are explained. And finally, some scripting examples are provided with comments.





The Basics of Postfix Operators





Special Situations





Some Script Examples


Expression Giving Comment
var x = 4;
alert(x++);
4 Post-Increment
postfix operations adds one to the value after its value is used
var x = 4;
y = x++;
y = 4
x = 5
Post-Increment
variable y gets value of x before the post-increment
var x = 4;
alert(x--);
4 Post-Decrement
postfix subtracts one to the value after its value is used
var x = 4;
y = x--;
y = 4
x = 3
Post-Decrement
variable y gets value of x before the post-decrement


Top            

Rx4AJAX        About Us | Topic Index | Contact Us | Privacy Policy | 2008 This Site Built By PPThompson