cantstopthesignal@sh.itjust.works to Programmer Humor@lemmy.ml · 2 years agoThe code was very janky, but it workedi.imgflip.comimagemessage-square23linkfedilinkarrow-up117arrow-down10
arrow-up117arrow-down1imageThe code was very janky, but it workedi.imgflip.comcantstopthesignal@sh.itjust.works to Programmer Humor@lemmy.ml · 2 years agomessage-square23linkfedilink
minus-squarePoolloverNathan@programming.devlinkfedilinkarrow-up2·2 years agoArray(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.
minus-squarecantstopthesignal@sh.itjust.worksOPlinkfedilinkarrow-up1·2 years agoTime is a flat circle
minus-squaremindbleach@sh.itjust.workslinkfedilinkarrow-up1·2 years agoYet the array contains exactly three nothings. It’s like a zen koan.
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.Time is a flat circle
Yet the array contains exactly three nothings.
It’s like a zen koan.