iteration order of an associative array
An associative array is an array of values indexed by a key (string) instead of an integer. In fact it is really just a generic object and using the array constructor does not give you any more functionality than an object because most of the Array API will not work (i.e. sort). But it still helps me to think of an object as an associative array, so the concept remains an important one to me.
When iterating through an object using a for… in loop, the order of the array cannot be guaranteed. I wonder, however, if the same associative array can be relied upon to iterate the same order each time. I thought so. But I was wrong. Recently I was debugging why my video controller was behaving differently on a PC vs a Mac and I discovered that the two platforms differed in how Flash was iterating through the video metadata object. Nice to know.
