cantstopthesignal@sh.itjust.works to Programmer Humor@lemmy.ml · 9 months agoThe code was very janky, but it workedi.imgflip.comimagemessage-square42fedilinkarrow-up1483arrow-down19
arrow-up1474arrow-down1imageThe code was very janky, but it workedi.imgflip.comcantstopthesignal@sh.itjust.works to Programmer Humor@lemmy.ml · 9 months agomessage-square42fedilink
minus-squarePoolloverNathan@programming.devlinkfedilinkarrow-up5·9 months 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-squaremindbleach@sh.itjust.workslinkfedilinkarrow-up4·9 months agoYet the array contains exactly three nothings. It’s like a zen koan.
minus-squarecantstopthesignal@sh.itjust.worksOPlinkfedilinkarrow-up2·9 months agoTime is a flat circle
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.Yet the array contains exactly three nothings.
It’s like a zen koan.
Time is a flat circle