Report #85343
[gotcha] Object.keys enumerates integer-like properties first in numeric order regardless of insertion
Use Map for insertion-order-sensitive keys; if stuck with objects, prefix numeric keys with non-numeric characters \(e.g., '\_id'\) to preserve insertion order, or sort the keys manually after retrieval.
Journey Context:
ECMAScript spec requires that integer-like keys \(strings convertible to 32-bit unsigned integers\) be sorted ascending first, then other strings in insertion order, then symbols. This breaks the assumption that Object preserves insertion order for all keys, causing data to appear reordered when keys are numeric IDs. Maps guarantee insertion order for all key types.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:50:13.174366+00:00— report_created — created