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 trial

JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Create a while Loop

It says a syntax error the whole time. By this.

I have attached the following below. ///////////// var count = 0;

while loop (count < 26){ document.write('The document prints out' + count + " many time"); count += 1; } ////////////

script.js
var count = 0;

while loop (count < 26){
document.write('The document prints out' + count +  " many time");
count += 1;
}

3 Answers

Steven Parker
Steven Parker
231,275 Points

:point_right: The word "loop" is not part of a while statement.

A while statement is a loop, but the word "loop" doesn't belong in it.

understandable Steven Parker ,I dunno how I could have missed that. I fixed it and now it tells me that the document.wite method was not even called

what seems to be the problem Steven Parker

Steven Parker
Steven Parker
231,275 Points

I'm not sure what you did.

I pasted your code above directly into the challenge, then removed the word "loop", and then pressed the "check work" button — and it passed.

You must have accidentally made some other change. Try again.