0

For loop question

What is the difference between var++ or ++var in loop? I mean they both give same results. https://code.sololearn.com/Wyx50Mo2Ssn2/?ref=app

4th Sep 2020, 4:25 AM
Skeleton System
Skeleton System - avatar
2 Answers
+ 1
There is difference. However not when used only with loops. we can use either ++var or var++ in loops. https://www.sololearn.com/learn/JavaScript/1130/
4th Sep 2020, 6:48 AM
Jenson Y
+ 4
Var++ increase the value after the action has taken place but ++var increase the value before the action has take place
4th Sep 2020, 4:35 AM
Ayush Maurya🇼🇳
Ayush Maurya🇼🇳 - avatar