Building on what @Ray Hidayat posted:
JavaScript arrays are sparse. If you have an array of length 3, deleting the reference at [1] will simply "unset" that item, not remove it from the array, or update that array's length. You could accomplish the same with
myArray = [0, , 2, , , , ]; // length 6; last three items undefined
Here's a Fiddle:
http://jsfiddle.net/WYKDz/
NOTE: removing items from the middle of large arrays can be computationally intensive. See this post for more info:
Fastest way to delete one entry from the middle of Array()
deleteandArray.prototype.splice, whereas this question is basically asking why deleting an element from an array (thus making it sparse) won’t reduce its length.