aldalire@lemmy.dbzer0.com to 196@lemmy.blahaj.zoneEnglish · 8 months agowork(rule)flowlemmy.dbzer0.comimagemessage-square25fedilinkarrow-up1110arrow-down10
arrow-up1110arrow-down1imagework(rule)flowlemmy.dbzer0.comaldalire@lemmy.dbzer0.com to 196@lemmy.blahaj.zoneEnglish · 8 months agomessage-square25fedilink
minus-squareProgrammingSocks@pawb.sociallinkfedilinkarrow-up8·8 months agoWhat the fuck kind of JavaScript fuckery is for (; ; i++)
minus-squareMetype @lemmy.worldlinkfedilinkEnglisharrow-up10·8 months agoi is already initiated so the first statement isn’t necessary so it’s empty. The loop is ended with a conditional break statement so the loop end criteria isn’t necessary so it’s empty. We want each iteration to increment i so it’s i++ That’s how you end up with (;;i++)
What the fuck kind of JavaScript fuckery is
for (; ; i++)
i is already initiated so the first statement isn’t necessary so it’s empty.
The loop is ended with a conditional break statement so the loop end criteria isn’t necessary so it’s empty.
We want each iteration to increment i so it’s i++
That’s how you end up with (;;i++)