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 trialQasim Rashad
Front End Web Development Techdegree Student 7,837 Pointshelp with, While loop
I've done everything right but I've notice the Document.write is a little off, what can I do to fix the solution?
var count = 0;
while (count < 26) {
document.write('# of loops');
count += 0;
}
2 Answers
Agnes Demes
6,613 PointsHi, There are a couple of things in your code that will not let you pass this quiz. console.log('# of time'); would print the string 26 times such as:
1) # of times # of times # of times # of times # of times # of times etc so instead of adding a string you need to insert the count value ( count);
2) count += 0 means take the current value of count and increase it by 0, therefore it would stay the same. you need to have count+= 1;
Andrew LeQuang
4,970 PointsYou want to document.write the variable count. ‘# of loops’ is not a defined variable.
document.write(count);