Why is this solution not accepted?


Hey, community!

I'm trying to understand what is it wrong with my code. It returns me an error, however gets the job done: the phrase is printed three times, with no repetition of the console.log code.

Thanks in advance,


error message: Oops, try again. Hey now--only one console.log() call!

var count = 0;
function loop() {
    while (count < 3) {
        console.log ("I'm looping!");




Adjust it so it loops 3 times: count<4, rather than 3.

Otherwise, it looks fine.


Hello, Orion! :slight_smile: Thank you for your response.
The thing is it does print three times. It actually works in every way, but, for some reason, the lesson wouldn't let me through with this code.

If I change it to <4, as you suggested, it would print 4 times: for 'count' being equal to 0, 1, 2 and 3.


The code runs alright for me... I don't think there's any error at all.


i agree with @envyennui, i think you hit a glitch. Try refreshing page/different browser


Oops... I can't read. :wink:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.