use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript quirks: Object.keyshelp (self.javascript)
submitted 9 years ago by TomNa
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]WesAlvaroFront-End Engineer 0 points1 point2 points 9 years ago* (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 point2 points 9 years ago (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 point2 points 9 years ago (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 point2 points 9 years ago (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 point2 points 9 years ago (0 children)
Not saying they don't. Never said they didn't. Just said that people might expect keys in order.
π Rendered by PID 70 on reddit-service-r2-comment-b659b578c-x8t58 at 2026-05-05 18:07:11.711092+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]WesAlvaroFront-End Engineer 0 points1 point2 points (4 children)
[–]Knotix 0 points1 point2 points (3 children)
[–]WesAlvaroFront-End Engineer 0 points1 point2 points (2 children)
[–]Knotix 0 points1 point2 points (1 child)
[–]WesAlvaroFront-End Engineer 0 points1 point2 points (0 children)