+ 1
What is the difference in the operations?
Operation 1 ------------------ var a = 1 ++a print("a") ------------------ ************ ------------------ Operation 2 ------------------ var a = 1 a++ print("a") ------------------
2 Answers
+ 3
In your case there is not.
(Are you sure there is quotes around a ?)
If you want to see a difference, try to put operation directly in your "print".
Look:
var a = 1
print(a++) //Output: 1
----------------
var a = 1
print(++a) //Output: 2
In the first case, the operation is did after the value is display.
In the second, the operation is did before.
Hope I could help despite my english level ;)
0
Thanks for this explanation I knew the answer but not the process of how the answer came.