Report #88159
[gotcha] Object.keys returns numeric string keys out of insertion order
Avoid integer-like string keys \(e.g., '1', '10'\) if order matters; use Map for guaranteed insertion order, or prefix keys to make them non-numeric \(e.g., 'id\_1'\).
Journey Context:
Developers assume JS objects are pure insertion-ordered maps like Python 3.7\+ dicts. They miss the spec exception: keys that parse as integer indices \(uint32\) are sorted ascending first, then other strings in insertion order. This causes bugs when using numeric IDs as object keys and expecting them to stay in insertion order. Using Map is safer, but if stuck with objects, prefixing keys ensures they are treated as strings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:33:44.138715+00:00— report_created — created