4 ms·
It seems that this library relies on hash keys being returned in the same order that they appear in a literal hash constructor. I.e., if var x = { "b":3, "a":10
by spacejunkie 15y ago
It seems that this library relies on hash keys being returned in the same order that they appear in a literal hash constructor. I.e., if var x = { "b":3, "a":10 }, then for (n in x) will _always_ assign n to "b" first before assigning it to "a".
Is this something that is guaranteed by javascript?
- vjeux 15y agoAll the browsers use the correct order for non integer keys. So unless you name your key "123" it will work. See this bug report for more lengthy details http://code.google.com/p/v8/issues/detail?id=164 http://code.google.com/p/v8/issues/detail?id=164
- carussell 15y ago> Is this something that is guaranteed by javascript? In theory? No. In practice? ... Still no, if you use delete. https://developer.mozilla.org/en/JavaScript/Reference/Operators/Special/delete#Cross-browser_issues https://developer.mozilla.org/en/JavaScript/Reference/Operat...