I'm building the following array:

var ax = []
ax['aaa'] = 1
ax['aab'] = 2
ax['aac'] = 4
ax['aad'] = 6

I would like to loop though all of the values in this array.

If I do the following, I get nothing:

ax.each(function(s) {
        alert(s)
})

...but if I do the following, I get my values, followed by all the
names of the Prototype enumerable method names.

for(s in ax) {
        alert(s)
}

I've even tried this, which behaves in a similar manner:

var ah = $H(ax)

ah.each(function(s) {
        alert(s)
})

What am I doing wrong here?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to