Why isn't this loop outputting anything?

This is my loop. Why isn’t it logging to the console?

for (let count = 3; count > 8; count++){
  console.log(count);
}

Hello! It isn’t outputting because your condition is run the loop while count is greater than 8. Since count is less than 8, the loop will never run, as the condition is never met.
I hope this helps!

2 Likes

Ohhhh, I feel stupid now :man_facepalming:

I thought it was the other way around, that it would stop when it reached that value…

Thanks for the quick reply :smile:

2 Likes