this post was submitted on 29 Feb 2024
17 points (100.0% liked)

196

16504 readers
3694 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] ProgrammingSocks@pawb.social 1 points 8 months ago (1 children)

What the fuck kind of JavaScript fuckery is for (; ; i++)

[โ€“] Metype@lemmy.world 3 points 8 months ago

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++)