How to stop False condition from displaying!


#1

Hi,

Okay so I've created a basic FOR and WHILE loop, but for the WHILE loop, we have to add the:

condition = false;

When we do, it displays everything correctly but also display FALSE, how do we keep that condition but stop it from displaying FALSE on the black display screen.
Here is my code:

for(var i = 1; i<10; i++){
    console.log("I'm Bruce Wayne");
}

var condition = true;
while(condition) {
    console.log("I'm Batman");
    condition = false;
}

#2

Add to end of code:

console.log("No display false");

#3

I did that, but instead of getting FALSE, I get that "No display false" string?


#4

That is the whole point?


#5

It is secret code that tells the computer not to say "false".


#6

No, I want the results to say "I'm Bruce Waye" 10x (which it has), "I'm Batman" (which it has) and that's it..but I also get "false" underneath all that.
I want to remove false from displaying but obviously keep that line of code.


#7

console.log(" ");

#8

Thanks it worked, give your self a gold sticker :smiley:


#9

Gladly!

I'll put it right on my forehead. :laughing: