When Object.keys is called in @v8js, no guarantees are made about the order of the keys in the returned array. In practice, they are sorted alphanumerically on the first ten characters of the key. Why ten? Twelve would be nice. Sixteen is also a nice number.
What makes you say that? All JS engines follow the same order as far as I can tell. The spec has a bug: https://github.com/tc39/ecma262/pull/1242 …pic.twitter.com/UBV0hp3mUF
-
-
Thanks for that link, that helped me narrow it down. If a key is a String and a valid number it is sorted in ascending numeric order, but only using the first ten characters of the string.pic.twitter.com/BTGxs510QY
-
Sidenote: if your curious why I'd wanted to use long numbers as keys, they are timestamps.
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.