--- In [email protected], Gordon Smith <[EMAIL PROTECTED]> wrote:
> The Flash player implements both Array and Object as hashtables. In
Two somewhat related questions:
1) How does the implementation work with "for in" loops? Is there any
natural order in which the propery names are returned? Does this vary
from an Array to an Object?
2) Is there an "efficient" way to walk a sparsely populated array in
order? That is if a[2], a[100] and a[2000] are the only elements of
an array, is there a way to visit the three nodes in order without
testing all the "empty" elements between the sparse nodes.
for (var i:Number=2; i < a.length; i++) {
if (a[i] != undefined) ...
}
If the array elements were created in order of the increasing index,
would that help? That is, walking the sparse elements in creation
order would suffice in this case.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/