+ 2
x++, ++x, x--, - - x
What different? Example?? 😉
3 odpowiedzi
+ 2
If you write ++ before the variable, the addition is made before the statement. If you write it after the variable, it is made after the statement. Example:
// both x and y will be 4
var x = 3;
var y = ++x;
// x will be 4, y will be 3
var x = 3;
var y = x++;
+ 1
sudah kejawab tuh ☺
+ 1
++x; // x = x + 1; return x;
x++; // return x; x = x + 1;