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

do know what I'm doing worng

I'm to make a while code that counts to 26

script.js
var count = 0;
while ( counter < 26 ) {  
  var count
   document.write( 'count ');
  count += 1:

1 Answer

Mckenzie Hessel
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mckenzie Hessel
Full Stack JavaScript Techdegree Graduate 20,437 Points
  1. Your variable is named "count" but you wrote "counter" in the while loop.
  2. You don't need to repeat "var count" inside the loop.
  3. You didn't put the closing brace ( } ) on the end
  4. Inside document.write(), count should not be in quotation marks (if it is the computer will think you want to print the string "count")
  5. You have a colon after your last line of code

It should look like this:

var count = 0; while ( count < 26 ) { document.write(count) count += 1 }