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

Hasmeet Puri
Hasmeet Puri
Full Stack JavaScript Techdegree Student 2,140 Points

My code takes too long to run on the task for looping 26 times. Does anyone have example code that gets past this?

Is anyone getting this issue?

script.js
var count = 0;

while (count<26){

document.write();

}

1 Answer

Gabriel Pierce-Lackey
MOD
Gabriel Pierce-Lackey
Treehouse Moderator 10,992 Points

Your code looks to be stuck in a loop. You're not adding to the count inside of the while loop so it's just writing nothing to over and over. You also want to write the variable "count".

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