My first while loop almost made a webpage crash 200 times in a row | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
My first while loop almost made a webpage crash 200 times in a row
Last Tuesday I was learning loops in a free JavaScript course and wrote a counter to print numbers 1 to 10. I hit run and the browser tab froze, then pasted the whole screen with the same line repeating over and over. Turns out I put the increment outside the loop, so the counter never moved and the browser just kept going forever. I closed the tab after about 200 copies of the same line, and my laptop fan sounded like a jet engine. Now I always double check where my counter update sits, but did this happen to anyone else on their first loop?