What's missing is associative arrays in JavaScript. As to adding  
elements in a (Prototype) Hash, Szymon already gave you that:

ax.set('aad',4);

And there's a matching get() function to pluck an individual element  
out of the Hash, too.

ax.get('aad') //--> 4

Walter

On Apr 2, 2009, at 11:04 AM, Diodeus wrote:

> The problem is in my case, I'm adding elements to the array as I go,
> as opposed to building it as a JSON-type hash up front.
>
> I'd like to be able to do:
>
> ax[newValue] = y
>
> Looping through an associative array should be simple, but I'm missing
> something 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