you started with myVar being equal to 87
then you added 1. So now myVar is equal to 88.
Then you re-assigned 88 again to myVar.
Then you increment myVar by 1.
What is now the value of myVar?
I do not understand really what I am doing, I need more explanations. What´s the point of doing this? I mean, am I doing an arithmetical sum or just telling what it should do, sum 1 + var?
The point is to gain an understanding of the different ways of incrementing a number. The fact that you’re having difficulty with is why you’re doing it. Because this is pretty basic and things you need to understand when progressing.
Yes, I understand now I thought there were some more mistery! Now I am struggling to understand the difference between ++myVar and myVar++, for me looks the same
The difference is that ++myVar will return the incremented value of myVar while myVar++ will return the old value of myVar. So writing myVar = ++myVar (though completely pointless other than as an example) will increment myVar by 1 then return the value of myVar. Writing myVar = myVar++ will increment the value of myVar, return the old value and set myVar back to the old value. In this case it’s just to demonstrate how they work, but it can be useful in many cases.