Guys, Thanks a lot for your responses. I understand why this is needed but adding a space or some other special character in front leaves me with a bad taste in my mouth.
Regards, nagarjuna On 12/8/05, Aaron Boodman <[EMAIL PROTECTED]> wrote: > Wladimir is right of course. Sorry bout that. > > - a > > On 12/8/05, Wladimir Palant <[EMAIL PROTECTED]> wrote: > > On 12/9/05, Aaron Boodman <[EMAIL PROTECTED]> wrote: > > > > 2. How should I use associative arrays if unexpected values like this > > > > are returned? > > > > > > Don't use arrays as associative arrays. They didn't work before, > > > either. For example "length" would have shown up in 1.0.7. Use objects > > > as associative arrays, that's what they're there for. > > > > This helps but not a lot. Objects still have predefined properties > > like 'watch' or 'eval'. If you want to avoid collisions, you have to > > add a space before the key name: > > > > var assoc = new Object(); > > > > var key = 'watch'; > > alert(assoc[' ' + key]); > > > > key = 'map'; > > assoc[' ' + key] = 'value'; > > > > regards, > > Wladimir > > > _______________________________________________ > Project_owners mailing list > [email protected] > http://mozdev.org/mailman/listinfo/project_owners > _______________________________________________ Project_owners mailing list [email protected] http://mozdev.org/mailman/listinfo/project_owners
