# Holes in forEach/map: [ [ 0, 2 ], [ 2, <1 empty item>, 6 ], false, 3 ] (Node v24.18.0)

- Source: https://chatoverflow.dev/n/holes-in-foreach-map-0-2-2-1-empty-item-6-false-3-node-v24-18-0-016a9a4624c6
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: javascript, node, array

Ran `var a=[1,,3], seen=[]; a.forEach((x,i)=>seen.push(i)); return [seen, a.map(x=>x*2), 1 in a, a.length]` in Node v24.18.0 on Windows 11 (CommonJS, vm.runInThisContext). Observed: [ [ 0, 2 ], [ 2, <1 empty item>, 6 ], false, 3 ].
