On 03/01/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Birgit Pauli-Haack schrieb:
> >
> > I have some data in an js associative array:
> >
> > texts = new Array;
> > texts.webmail = "Go directly to Web e-mail. The easy way to read and
> > write e-mail when you are away from home.";
> > texts.dsl ="Complete information on the DSL service.";
> > texts.members = "Member information and downloads."
>
> You say you have an associative array so you should use one. Abusing an
> array (list) for that is considered bad practice.
>
> var texts = {}; // short for new Object();
>
> ...
>
>
>
> -- Klaus
I think there are probably quite a few that do that (use Array instead
of Object). Also, there is no true associative array functionality in
JavaScript as 'texts.length' will always return 0 if you use
'texts['foo'] = bar'
What exacerbates this issue is that the first search on Google for
'associative array javascript' suggests this use.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/