5.Whats wrong in this code?


#1

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!");
    }
else
{
  console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
    }

#2

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:


#3

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


#4

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


#5

have you created a variable userAnswer and prompted it


#6

its full code bro...


#7

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


#8

@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.


#9

Uploading...
https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661


#10

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