0
Please help
var a=10; a=a++; document.write (a); shouldn't the result be 11? I tried this in the Code Playground, but the result turned out to be 10
2 ответов
+ 12
a++ is post increment, so a is assigned the value of a (10, instead of 11). The increment happens after the assignment, to the ghost variable of a, thus making no difference to the real a.
+ 1
Try ++a; rather than a=a++;