Solo flight 6/11


#1

var myCondition = true;

var soloLoop = function()
{
while(myCondition)
{
console.log("Looped Once!");
myCondition = false;
}

};

soloLoop();

what is wrong with here? i can print "looped Once!" in the console but it says "Oops, try again. It looks like you're not printing the right string to the console." thanks


#2

It may seem ironic, but it takes it as wrong if you put "Looped Once!"instead of "Looped once!".


#3

man, Thank you, its case sensitive here i forgot :smiley:


#4

var soloLoop = function(){
//Your code goes here!
var myCondition = true;
{
while(myCondition);
{
console.log("Looped once!")
myCondition = false;
}
};

soloLoop();

please help, I have no idea what i'm doing


#5

Missed out the semicolon after console.log("Looped once!") ?


#7

Hello guys,

Why should I fave to use a function in this case?
I did:

var soloLoop = 0;
    while (soloLoop === 0) {
     console.log("Looped once!");
     soloLoop++;
 }

And it worked. I thought in make a function, but this way worked too.
Another question, do I always have to pass an argument to the function?

Thanks a lot guys