Report #7969
[gotcha] new Array\(3\) creates a sparse array with 3 empty slots, not \[3\]
Use Array.of\(3\) for single-element arrays, or Array.from\(\{length: 3\}\) for sparse iteration; avoid new Array\(n\) unless you specifically need empty slots
Journey Context:
The Array constructor is overloaded: single numeric argument sets length, array of arguments sets elements. This creates sparse arrays \(holes\) which behave strangely in iteration \(skipped by map/filter\). Alternatives considered: literal \[3\], Array.of, Array.from. The fix is explicit factory methods.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:14:33.097096+00:00— report_created — created