The story heats up! 5/7 script.js


Oops, try again. There was a problem with your syntax.

<Below this line, add a link to the EXACT exercise that you are stuck at
this line, in what way does your code behave incorrectly? Include ALL error messages.>
// Check if the user is ready to play!
confirm(" Are you ready to Play!")
var age = prompt("what is your age")
if( age <= 13)
console.log("You can play");
console.log("You can not play");
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?");
//var userAnswer = "yes";
if( userAnswer = "yes");
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");



The Box Model

Image courtesy of!



You have to take a look again at your

if( userAnswer = "yes");

You are comparing it to a string, which means that you have to modify your comparison operator '='. You have to see it as it's 'equal to' yes.


I do not believe there should be a semi colon after your if condition.
if( userAnswer = "yes")


Thanx. I replaced it by ===.


And after removing the semicolon after the condition if ( userAnswer ="yes") it worked. Thanx


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