6/11 Did you log 'Looped once!' to the console?


#1

Hi,
so the answer is probably very obvious but I'm having trouble with question 6/11. When I submit the code it says: "Oops, try again. Did you log 'Looped once!' to the console?" Only I don't know what I'm doing wrong. Here's my code:
`
var soloLoop = function(){
var condition = false;
while (condition){
console.log("Looped once!");
bool = false;
}
};

soloLoop();
`
Can anyone tell me what I did wrong here?
Regards,
Maartje.


#2

you declare a variable on line 2:

var condition = false;

then you use this variable in your loop:

while (condition){

the condition is a bool value (false), so the loop won't execute. i suggest your condition should be true (line 2) and make sure you update your condition variable in the loop


#3

Thanks :grinning: Worked for me!