[thelist] Javascript array label index

Andreas Wahlin Andreas.Wahlin at ufl.gu.se
Fri Sep 10 08:08:51 CDT 2004

I'm trying to create an array with a label index, thusly

array["label0"] = value0
array["label1"] = value1

alert(array["label1"]) // pops up value1

Now this works, though I'm not sure if it's actually an array or if it's
an object that I can index in some way (perhaps someone can shed
light?). The important thing I'd like to do however is loop through this
in some way, but I can't figure out how to do it. It'd be nice to have
some form of enumerator or simmilar as well. It would have been nice if
the label arrays had number indexes, so that 0 corresponds to "label0"
but that doesen't seem to be the case. 

Anyone? It might be noted perhaps that what I really want it for is asp
code that I run in javascript "mode" (I might not offer the best
technical description, I'm more of a client side person, therefore I
prefer javascript to vbscript)


More information about the thelist mailing list