+ 1
Can somebody explain me about Increment and decrement operator?
In the course the comment section says its wrong .
3 ответов
0
var x, y, a, b;
x = 1;
y = 2;
a = x++; // a = 1, x = 2, first we use x, then increment it
b = --y; // b = 1, y = 1, first decrement y, then use it
0
The increment in above example is post increment in which first value of X is assigned to a and after that the value of X is Incremented by 1.
The decrement is pre decrement which means fir at the decrement is done in rhe value of y and the decreased value is assigned to b
0
Thanks mates, Highly appreciated for your answers 🙌🙏🙏