> If you're wrong you can deoptimise and fix-up to the same base-line performance.
but how do you know it's wrong (if the iteration order of a .keys() call isnt the same)?
but how do you know it's wrong (if the iteration order of a .keys() call isnt the same)?
But a much more common case is that properties added after object creating will be added in an inconsistent order, for example:
o = {}; o.x = 1; o.y = 2; o.z = 3;
p = {}; p.y = 4; p.x = 5; p.z = 6;
When executing p.y = 4 you don't know that the object will eventually evolve to have the same properties as o.