Report #17062
[gotcha] Object.keys enumerates integer-like keys in numeric order before other strings regardless of insertion order
Use Map for insertion-sensitive ordering; for objects, avoid integer-like keys \(e.g., prefix with '\_'\) if insertion order must be preserved.
Journey Context:
ECMA-262 OrdinaryOwnPropertyKeys sorts string keys that match integer indices \(0 to 2^53-1\) numerically first, then other strings by insertion. This causes '10' to sort before '2', and breaks API response ordering where IDs look like integers. 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-17T04:21:21.817853+00:00— report_created — created