Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialsami thakur
970 Pointswhy does this keep crashing my browser???
im trying to take this code to see whats wrong with it, and whenever i use workspace, and open this code, it crashes my browser, wether it mozilla or firefox
var counter = 1;
while (10) {
document.write("<p>Now in loop #" + counter + "</p>");
counter + 1;
}
1 Answer
Patrik Horváth
11,110 Pointswhile (counter < 10) and counter++; not counter +1 :)
your while is like while 10 = 10 xD its always TRUE so INFINITY LOOP :)
sami thakur
970 Pointssami thakur
970 Pointsoh ok xD, ty i was really confused for a bit
Patrik Horváth
11,110 PointsPatrik Horváth
11,110 Pointsnp :) mark me as ANSWERE :)