DEV Community

hwangs12
hwangs12

Posted on

Difference between i++ and ++i

When you assign to another variable like so: j = i++, j will get non-incremented i value. j = ++i on the other hand, j will get i+1. So, that is what people mean by 'increment first, then assign (++i) vs assign then increment (i++)'

Top comments (0)