0
What is ++a or --a ?
4 ответов
+ 4
The same as a++ or a--, but the increment happens immediately, instead of after the statement.
var x = 1;
document.write(x++); // the output would be 1
// now x is 2
document.write(++x); // the output would be 3
+ 2
As I already explain the different position determines when it happens, not what happens.
0
simply saying pre increment and post increment works similarly but.... ++a does addsn and --a does subsn by one. it first increment / decrements then executes.
0
So is la a++ or a--