I was working with splice within a nested for loop and I came across a behaviour I could not understand.
splice
var a = [0, 1, 2, 3, 4]; for (b in a) {
After you remove element 1, then "a" looks like:
[0, 2, 3, 4]
The new element 1 is 2. The next iteration of the loop, then "c" is 2, and a[2] is indeed 3.
a[2]