How I can make a true condition?


#1

Below is my correct code. I understand when it is false but i also have tried to do a true condition and I don't know how to do this in a good way. I know that I have to change false into true and remember to write a false condition between "while". Please explain me this.

var noIdea=false;
var getToDaChoppa = function(){
  // Write your do/while loop here!
 do {
     console.log("It is hard!");
}
while(noIdea)

};

getToDaChoppa(noIdea);

#2

Here is a post on loops in general:
http://discuss.codecademy.com/t/faq-and-some-explanations-about-loops/1201
and some examples on how a do while loop could look like:

Code
console.log("get the number of times a coin is not heads");

// get randomly either 0 or 1

var counter = 0; //count "coin flips"
do{    
    var coin = Math.floor(Math.random()*2);
    counter++;
}while(coin != 1);
console.log(counter);

console.log("Force the user to input correct password");
do{
    var pw = prompt("Please enter your password");
}while(pw != 12345);

or what do you mean?


#3

Thank you! It was really helpful :smiley: