[ka-Map-users] ka-Map map file list bug
Tim Schaub
tim at commenspace.org
Thu Jan 19 13:27:55 EST 2006
> this.aMaps[oMap.name] = oMap; [line 1548]
>
> which creates a JavaScript associative array object element
Good point. Since JavaScript doesn't actually have "associative
arrays", it would really make more sense to initialize this with:
this.aMaps = new Object();
Then, folks wouldn't be tempted to use Array properties like length.
> However, since the aMaps array was loaded as an associative
> array, aMaps.length is always zero
Right, this is a typical problem when people are accessing what are
really just properties of an Object (instead of elements in an Array).
You'd also get unexpected results if you tried to use Array specific
methods like join(), shift(), sort(), etc.
> David
>
Tim
More information about the ka-Map-users
mailing list