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

Can anyone please help me with this challenge..!

Can anyone please help me with this challenge..!

script.js
var count = 0;

while(count <= 26){
doucment.write( count );
count += 1;
}

1 Answer

Andreas Nyström
Andreas Nyström
8,874 Points

Hi.

First of all it should run 26 times. You run it 27 times (index starts at 0 not 1!). So i changed to count < 26 instead of count <= 26. Second you misspelled document. So i fixed that. I also wrote count++ (which is the same as count += 1). Hope this helps buddy. Keep going!

var count = 0;

while(count < 26){
document.write( count );
count++;
}