0
What is the difference between ++a and a++.
I am learning javascript please clear my the doubt with simple example
3 Answers
+ 6
https://www.sololearn.com/discuss/531271/?ref=app
+ 4
++a increments the value of a at the same instant as its executed ,but a++ will increment the value of a after its used once.
ex:
int a,b;
a=7;
b=++a;
cout<<b; //this will return 8.
but,
b=a++;
cout<<b; //this will return 7only .