Object properties (JavaScript does not have true multidimensional or associate arrays) have no defined order, and can only be accessed via their string key.
The order of iterating over keys with a for ( in ) is implementation specific as no order is specified in the specification. For example, Chrome orders numeric keys no matter what order they are added (as an array related optimisation for V8).
If you decide you don't want to listen to me and want to live dangerously, you could get the first property according to the JavaScript implementation with var worksExceptWhenItDoesnt = myArray[Object.keys(myArray)[0]].