Ian Hickson wrote:
On Tue, 28 Apr 2009, John J. Barton wrote:
  
And then afterwards the |length| is ? one? three?
    

One.

  
If I iterate
  for(var i = 0; i < sesssionStore.length; i++) foo(i, sessionStore[i]);
what can I expect in foo()?
     (0, null), (1, null), (2, "2")
or
      (0, "2")?
or ?
    

(0, "2").
I reiterate my criticism: using a length property in this type is inconsistent with _javascript_ and with developers expectations about objects. Every time we use this object we will make pointless mistakes because the type mimics arrays only partially and we won't be able to recall which part it imitates. A simple change from |length| to a method call like getNumberOfItems() would prevent this co-incidental mimicry and make the standard better.

jjb

Reply via email to