Help on 4


#1

The problem is that when the table that asks me the questions shows up I don't know how to answer when it asks me:"Do you want to race Avicii?".Every answer that I give is wrong please help

// Check if the user is ready to play!
confirm ("Ready to play?");

// prompt user for their age
var age = prompt("What's your age");

if (age < 13)
{
//do this
console.log("Play at your own risk.");
}

else //otherwise
{
//do this
console.log("Play on!");
}
console.log("You are at a Avicii concert, and you hear this lyric 'Lace my shoes off, start racing.'")
console.log("Suddenly, Avicii stops and says, 'Who wants to race me?'");

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


#2

var userAnswer =prompt("Do you want to race Avicii on stage? yes(y) or no(n)").toLowerCase();

if (userAnswer.trim().charAt(0) == "y"){
//renderAdventure();
}
else if(userAnswer.trim().charAt(0) == "n"){
// its all up to you buddy
}

else{
//wrong input
}

is this what you wanted


#3

Kind of, but still when the table that is supposed to ask the user if he wants to race Justin Bieber on stage says to me error when I type yes.


#4


#5

confirm(" Are you Ready to Rumbleeeeeeeeeeeeeeeeeeeee!!!!!!!!!!!");
var age = prompt("please give your age: ");
if (age < 18){
    console.log("Oooops!!!!!! It appears you are a Minor!!!!!!!!!.You are allowed to play but we take no responsibility for any inconviniences.");
}
else{
	console.log("Come Right in!!!!!!!!!!! cos its time to rock an roll");
}
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?'");
userAnswer = prompt("Do you want to race Bieber on stage? ");

//==============================================================================
//You need only up to this point for 4 and  the rest for 5 and 6(remember to print exactly as they say)



if (userAnswer.trim().charAt(0) == "y"){
    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 out of 10: ");
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

ok but what should I type when the table appears and says are you ready to play justin Bieber?


#7

push y or yes but it wouldn't matter because we are only checking the first letter.I had to redo this challenge because they changed it since the time i completed it. I passed it with this