5. Practice makes perfect



The activity wants me to print a string without using 3 console.logs. I think I am able to do it with the code below but I get the error message: "Oops, try again. Hey now--only one console.log() call!". My output is "I'm looping! I'm looping! I'm looping!".


var counter = 0;

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



Everything looks good other than you should use a semicolon after the closing } of your function.


I guess just ignore the error message perhaps. Cheers


In this case yes, but always pay close attention to error messages - they are very helpful! Sometimes codecademy's custom error messages will throw you off though.


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