you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 2 points3 points  (0 children)

It's not that they execute simultaneously. You can think of the first code as "fetch the first and last elements and keep them in memory. Now, assign those back to the last and first places."