var a=1;
b=++a*a;
console.log(b);
console.log(a);
the result is 4,2.how the program get this result? in my mind,the result will be 2,2
can anybody tell me how the javascript compiler compile this piece of code and get the result 4,2.
Then the deep question is why these two pieces of code result are the same.
var a=2;
var b=3;
c=(a++)*a;
console.log(c);
var a=2;
var b=3;
c=(a++)*b;
console.log(c);
can anyone explain this one step by step?