- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › I am leaning js on www.codecademy.com and it says I need an if statement
This is my code and it says that I need an if statement even though I have one
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 shoelace!");
}
else
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
A Codepen demo would be much more use to be honest.
I didn’t exactly get your point.
Please Use a live demo tool like CodePen.
http://codepen.io/anon/pen/XbXWPj
This is what I have. Is the if statement incorrect or what?
codecademy is teaching me to use prompt (for now)
it requires that I code everything a spacific way