5.Whats wrong in this code?


var userAnswer = prompt("Do you want to race Bieber on stage?");

if(userAnswer === "yes")
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
  console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");


I'm not entirely sure, but maybe it's where your braces, {}, start and end. I included a picture of my code and it worked fine so maybe it's your earlier code?

Let me know. :slight_smile:


brakets are ok. bro if their had any other problem just tell me


@bitrunner18403, please post your full code and error message. Because this part of code is correct (but not so clean).


have you created a variable userAnswer and prompted it


its full code bro...


Indentation maybe? It seems like the if is shifted by one or two blank spaces...


@bitrunner18403, please post your full code and error message.

Where is your error message?? I asked full code and error message. Just post error message if you posted full code. OR LINK to this lesson. Everything I said can help us to understand what is the problem.




This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.