Hi. I work on Firebug, a web page debugger for Firefox (http://getfirebug.com).

In attempting to show developers relevant information about all objects in their program I was trying to display window.sessionStorage. In the process I read the document http://dev.w3.org/html5/webstorage/. I found the document unnecessarily confusing because it uses the property 'length' for Storage. This is the same property used by Javascript Array type, but Storage is not an array and you cannot enumerate the elements of the Storage object |s| using
  for(var i = 0; i < s.length; i++)...

Any number of other names for the property would be equally effective for your propose without confusing developers with a property that implies array-ness. For examples, 'totalItems', 'numberOfItems', 'size', 'entries', or even good old 'n'.

Using the term "enumeration" to mean "property enumeration" is also confusing, but I suppose ECMA script made that mistake too long ago.

jjb

--
______________________________________________________
John J. Barton email: johnjbarton<at>johnjbarton.com http://www.johnjbarton.com



Reply via email to