Ad
  • Custom User Avatar

    The object doesn't even contain undefined items. It only has length. There's a difference between existing properties that happen to be undefined and actual missing, or empty, ones. Cf. [undefined,0] vs. [,0] ( yes, that's valid JS ). But if you ask for a non-existent property, JS will not throw a ReferenceError, but give you undefined instead, unlike when you ask for a non-existent variable.