Coding the Adventure with Bieber- Can't find error


#1

confirm("Ready to play?");
var age =prompt("What's your age?");
if (age < 13); {
console.log("you can play but I take no responsibility");
}
else {
console.log("Good Luck!");
}
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("You and Bieber start racing. It's neck and neck! You win by a showlace!");
}
else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}


#2

Remove the semicolon.

Remove the semicolon.


#3

@designrunner10658
If you don't remove that colon, JavaScript thinks that it is the end of the line and won't "see" the curly bracket({...}). I am not that great with JavaScript, but I think that is how it works.
@jibblyj
Is that why you suggested those changes?


#4

That's it Thank you very much


#5

Yes.

I know. You're very welcome :slight_smile:


#6

// Check if the user is ready to play!
confirm("We are Gonna Play Today,What About you ?");
var age = prompt("What Your Age ?");
if (age > 13)
{
console.log("Hey Let me show you How I can play");
}
else
{
console.log("Please Grow Up to Play The Game");
}

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 Biber on Stage?");
if (userAnswer==="yes") {
console.log("You and Bieber start racing. It's neck and neck! You win by a showlace!");
}
else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

Please Help Can Find the Error


#7

// Check if the user is ready to play!
confirm("We are Gonna Play Today,What About you ?");
var age = prompt("What Your Age ?");
if (age < 13)
{
console.log("Hey Let me show you How I can play");
}
else
{
console.log("Please Grow Up to Play The Game");
}

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 Biber on Stage?");
if (userAnswer == "yes") {
console.log("You and Bieber start racing. It's neck and neck! You win by a showlace!");
}
else {
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

I even Changed the Condition and Still get the same error!!!


#8

// Check if the user is ready to play!
confirm("We are Gonna Play Today,What About you ?");
var age = prompt("What Your Age ?");
if (age > 13) {
    console.log("Hey Let me show you How I can play"); 
}
else {
    console.log("Please Grow Up to Play The Game");
}
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 Biber on Stage?"); //Misspelled 'Bieber'
if (userAnswer==="yes") {
    console.log("You and Bieber start racing. It's neck and neck! You win by a showlace!"); //MIsspelled 'Shoelace'
} 
else {
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

Make sure that you log the exact messages that the instructions tell you to.


#9

// Check if the user is ready to play!
confirm("Ready to play");
var age = prompt("Enter your age");
if(age < 13)
{ console.log("you can play but your age is less to play this game");
}
else
{console.log("best of luck");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("// Check if the user is ready to play!
confirm("Ready to play");
var age = prompt("Enter your age");
if(age < 13)
{ console.log("you can play but your age is less to play this game");
}
else
{console.log("best of luck");
}
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?");

it is showing same error about console.log("Suddenly, Bieber stops and says,'Who wants to race me?'");


#10

Thank you.

Solved my problem

if (userAnswer === "yes") {

:slight_smile:


#12

when we input in userAnswer prompt and then we will submit our input then show that type of error.
Oops, try again. Did you remember to put in the 'yes' answer option? what should i do?


#13

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

do not work. (Oops, try again. Did you remember to put in the 'yes' answer option?).
Need help))


#14

// Check if the user is ready to play!
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("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.'");
}
//the same, don´t work


#15

A post was split to a new topic: Racing


#16