Ian Hickson wrote:
Sorry, I don't follow what you mean. The loop is possible of course,
but what should the result be? If I have a sessionStorage object |s|
with 10 items, the length will be 10. Should I expect |s[i]| for
i=0,..., 9? If so what will be the result, keys? items? Can I set
values, eg s = "howdy"?
On Tue, 28 Apr 2009, John J. Barton wrote:
Hi. I work on Firebug, a web page debugger for Firefox
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
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++)...
This is in fact possible.
Actually I take it back. The current document at the URL above only
uses enumerating once, and there is qualified by properties. I was
given a quote from an earlier document I suppose.
Using the term "enumeration" to mean "property enumeration" is also
confusing, but I suppose ECMA script made that mistake too long ago.
I'm just following WebIDL's terminology here.