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 trialThaddeus Lorenz
3,434 PointsConfused about the wording of the question
When the question is stating that they want to have something "printed," 26 times, what do they want printed? In the previous video they had 100 random numbers, do they want random numbers or am I making this way more complicated than the problem is asking? If someone could share me what they got I would appreciate it.
var count = 0;
while ( count < 26 ) {
document.write(count + ' ')
}
Steven Parker
231,269 PointsYou wouldn't pass the challenge with "count <= 26
". You'd have the wrong number of outputs.
2 Answers
Steven Parker
231,269 PointsYou're right, it's a bit vague.
But I don't think it matters what you print. Just how many times you do it.
So your output is fine as is. But to keep your program from running forever, you still need to increment your counter in the loop!
Thaddeus Lorenz
3,434 PointsHey Steven, I'm sorry I didn't update you, I was able to figure out the problem. Thank you!
Richard Scott
25,647 Pointsoops you're correct! thanks for spotting, I've amended it. Always helps to read the wording carefully! ha :)
Richard Scott
25,647 PointsRichard Scott
25,647 Pointsthe printed output is the result of the loop, in this case all the numbers betweed zero and 26
you could do it like this