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

196

16442 readers
1894 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
[โ€“] [email protected] 8 points 8 months ago (1 children)

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

[โ€“] [email protected] 10 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++)