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
Benoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 Pointsparse error again, possibly the syntax of the program isn't good
please check this program
var count = 0;
var doc=0;
while ( doc>=26) { (doc=0 + doc>=26 + doc +=1)
document.write( "numbers of copy!"; count" ");
return count;
}
1 Answer
Steven Parker
243,656 PointsIt sort of looks like you tried to write both a "while" and a "for" loop.
The "while" part is good syntax, but the test condition will fail.
A "for" loop would have the word "for" and then 3 expressions separated by semicolons inside parentheses. I see 3 expressions but they are separated by "+" instead and the word "for" is not there. And it has the same test condition as the "while" loop which would also fail.
And of course, you would not have both types of loop at the same time.