array.length method is not a count of array's items, but the highest index. even when the item was set to undefined. this behavior is hardly distinguishable from a language design bug.
var a = [];
a.length; // === 0
a[10]; // === undefined
a[10] = undefined;
a.length; // === 11
a.pop(); // === undefined
a.length; // === 10
this behavior is hardly distinguishable from a language design bug..