Home > Q&A > body text
var x=10;
var y=20;
y = x;//y=31
y=x y;//y=30
Why are the values different? Isn’t y=x y 31?
灭绝师太2018-04-12 13:02:48
Because when the code is parsed, it is not parsed into
x+ ++y
but into
x++ +y
Oh oh oh, okay, thank you teacher
++x increases by 1 before use; x++ increases by 1 after use.