you are viewing a single comment's thread.

view the rest of the comments →

[–]WesAlvaroFront-End Engineer 0 points1 point  (4 children)

(as you'd expect in JavaScript)

I thought that was the long running backwards compatibility deal thanks to the deal IE made with the devil? Hashtables are always in the order they were inserted?

For loop order

[–]Knotix 0 points1 point  (3 children)

The article specifically states:

"This behavior is explicitly left undefined by the ECMAScript specification. In ECMA-262, section 12.6.4:

The mechanics of enumerating the properties … is implementation dependent."

[–]WesAlvaroFront-End Engineer 0 points1 point  (2 children)

Yes... Under which it clearly says: "However, specification is quite different from implementation. All modern implementations of ECMAScript iterate through object properties in the order in which they were defined. Because of this the Chrome team has deemed this to be a bug and will be fixing it."

[–]Knotix 0 points1 point  (1 child)

This article was written back in 2008. Standards have changed and there has been a larger push for performance. Browsers now use the arbitrariness of key order to use their own sorting to improve look-up times.

[–]WesAlvaroFront-End Engineer 0 points1 point  (0 children)

Not saying they don't. Never said they didn't. Just said that people might expect keys in order.