+ 1

What is the difference in the operations?

Operation 1 ------------------ var a = 1 ++a print("a") ------------------ ************ ------------------ Operation 2 ------------------ var a = 1 a++ print("a") ------------------

2nd Nov 2016, 9:13 AM
Pratham
Pratham - avatar
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 ;)
2nd Nov 2016, 10:11 PM
Volts
Volts - avatar
0
Thanks for this explanation I knew the answer but not the process of how the answer came.
3rd Nov 2016, 5:40 AM
Pratham
Pratham - avatar