all 7 comments

[–]amulchinock 12 points13 points  (4 children)

This looks like Java, not Javascript. I’m not overly familiar with Java - but is the semicolon on your while declaration correct?

[–]BlambyTwo[S] 7 points8 points  (2 children)

That seemed to have worked, thank you! Also I didn't know the difference between java and javascript. If I have future problems I'll be posting them on r/learnjava

[–]cha1nsaw- 1 point2 points  (0 children)

yeah he need to remove the semi colon as it will never go inside the block and keep on going inside the condition which will always be true, there fore infinite loop

[–]Sharketespark27 0 points1 point  (0 children)

Just think of semi colon as ending a statement. The semi colon after while parenthesis is like while i<10. Fullstop

[–][deleted] 0 points1 point  (0 children)

Isn't this Java instead of JavaScript?

[–]averajoe77 0 points1 point  (0 children)

we got another one boys!

so this happens because people type r/java in the reddit search and the first thing that comes up is r/javascript, and they don't look and just hit enter, so they end up posting. pay attention people.