If(confirm("Shall we play a game?") === false) {console.log("Bye!");}


#1

I'm having a hard time making this work. I'm trying to use the boolean returned from the confirm statement to use a condition for the if loop. Any thoughts?


#2

Hey @chancecarmichael! You should just set the confirm to be a variable! So do this

Initialization:

   var confirming = confirm("Shall we play a game");

Then the conditon and also you should put false as a string(whitch is
where the problems comes in):

   if(confirming== "false"){
   console.log("Bye!");
   }

Hope this helped! If it didnt please reply saying so!


#3

Alright, that worked pretty well thanks. Should've known I could've just used a variable for something like that.


#4

No Problem Glad to help!