+ 5
How come this output
var a = 3; var b = ++a; var c = a++; console.log(b, c, a);
6 Answers
+ 8
++a adds 1 to 'a' and returns, while a++ returns 'a' and then performs the addition on next cycle.
So the output is like: 4 4 5
+ 5
+ 5
Thanks..
+ 4
Thanks
+ 1
result is (b c a) =4 5 3