• PoolloverNathan@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    8 months ago

    Array(3) doesn’t create [undefined, undefined, undefined, ]; it creates [/* hole */, /* hole */, /* hole */, ]. The holes don’t set any property on the array whatsoever, so they are skipped when iterating. How this makes sense, I can’t tell you.