Report #22442
[gotcha] JSON.stringify reorders object keys that look like array indices
Never rely on key order for mixed numeric/string keys; prefix numeric keys \(e.g., "\_1"\) or use Map/Array for ordered data
Journey Context:
Developers assume insertion order is preserved for all string keys, but ECMA-262 mandates that "0", "1" \(array indices\) are sorted numerically before other keys during enumeration. This causes HMAC signature mismatches when canonicalizing objects for APIs, as the server might stringify differently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:04:56.445076+00:00— report_created — created