Understanding Incrementing
- by Chad
For example this:
var a = 123;
var b = a++;
now a contains 124 and b contains 123
I understand that b is taking the value of a and then a is being incremented. However, I don't understand why this is so. The principal reason for why the creators of JavaScript would want this. Is this really more useful than doing it the PHP way? What is the advantage to this other than confusing newbies?