Help


#1


// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompt("What's your age");
var age = "13"
if(age < 13)
{
console.log("Stop right there!")
}
else
{
console.log("Go ahead!")
}
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? Type yes or no.")
var userAnswer = "yes"
if(userAnswer.length === 3)
{ 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.'")}
var feedback = prompt("Please rate the game")
var feedback = "===>8"
if(feedbak > 8)
{ console.log("Thank you! We should race at the next concert!") }
else { console.log("I'll keep practicing coding and racing.") }

What's wrong with my code??


Replace this line with your code.


#2

I would more easily be able to tell if you could format your code.


#3

// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompt("What's your age");
var age = "13"
if(age < 13)
{
console.log("Stop right there!")
}
else
{
console.log("Go ahead!")
}
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? Type yes or no.")
var userAnswer = "yes"
if(userAnswer.length === 3)
{
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.'")
}
var feedback = prompt("Please rate the game");
if(feedbak > 8)
{
console.log("Thank you! We should race at the next concert!")
}
else
{
console.log("I'll keep practicing coding and racing.")
}

Whats else can i do?


#4

Your fault is after "Do you want to race Bieber on stage? Type yes or no."
'var userAnswer = "yes" ' is wrong, you've already defined your var, after the prompt you should use an if/else statement:
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.'");
}
Same after "Please rate the game" delete the 'var feedback="===>8"


#5

So your entire code should look something like this:

confirm("Are you ready to play?");
var age = prompt("What is your age?");
if (age < 13)
{
console.log("you're allowed to play on your own responsability");
}
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'.Suddenly, Bieber stops and says,'Who wants to race me?' ");
var userAnswer = prompt("Do you want to race Bieber on stage? yes or no?");
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.'");
}
var feedback = prompt("Rate my game out of 10 pls :)");
if(feedback > 8) {
console.log("Thank you! We should race at the next concert!");
}
else {
console.log("I'll keep practicing coding and racing.");
}


#6

it's not working. it keeps appering "ReferenceError: feedbak is not defined"


#7

it's not working. it keeps appering "ReferenceError: feedbak is not defined"


#8

I think it's just a typo, it should be "feedback"