0
What's the difference between ++a and a++. When to use them?
3 Antworten
+ 4
a better answer to this is that x=a++ assigns the value of a to x and then increment a of one.
Doing x=++a will first increment a and then assign the value of a to x.
0
++a will give you new data
a++ will give you old data
eg. a=2;
then
z=a++;
document.write(z);
then output is 2
if
z=++a;
document.write(z);
then output is 3
0
ok