DEV Community

Discussion on: Why some think ++i is faster than i++ ?

Collapse
 
hamza profile image
Hamza Tamenaoul • Edited

If as an example a = 2, then arr[a++] requires the storage of the old value of a since after evaluating a++, a would be equal to 3, while it needs to access arr[2].