First Move!


#1

I keep getting the message "Oops, try again. do you want to race Bieber on stage?". My code is below, what am I missing?

// Check if the user is ready to play!
confirm("Aye aye captain!!");
var age = prompt("How old are you");
if(age < 13)
{
console.log("Cool, but you on yo own homie");
}
else
{
console.log("Let's get it!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Bieber on Stage?");
if(userAnswer === "Yes")
{
console.log("I'm bout to dust yo sorry ■■■!");
}
else
{
console.log("You wack");
}


#2

Hi it's maybe that .. this line

if(userAnswer === "Yes")

you wrote Yes with the uppercase Y so you should type Yes in the console. then here

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

the string should be

prompt("Do you want to race Bieber on stage?")

and you have

prompt("Do you want to race Bieber on Stage?")

the diff is at stage and Stage

And

You have more code then you need in this lesson
Hint
On that lesson you don't need of the second if statement


#3

I removed the capital S, got rid of the semi-colon, and removed my if statement. That worked!

So frustrating!! Thank you!!


#4

Wouldn't have to use an IF statement to be able to type in yes or no in the prompt box for "Do you want to race with Justin Bieber
Not sure whats going wrong ever time I try running it this error pops up Oops, try again. "Did you remember to console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'"); ? "

Heres my code

// Check if the user is ready to play!
confirm("I am ready to play")
var age= prompt("what is your age");

if (age < 13)
{
console.log("allowed")

}
else
{
console.log("play on")
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'who wants to race?'");
var userAnswer=prompt("Do you want to race Bieber on stage?");


#5

Hi here what You should print

("Suddenly, Bieber stops and says, 'Who wants to race me?'");

And here what You did

console.log("Suddenly, Bieber stops and says, 'who wants to race?'");

In yours it's missing me after race


#6

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