Forums

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 topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #201789
    tmarkwell16
    Participant

    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.'");
    }
    
    #201795
    Paulie_D
    Member

    A Codepen demo would be much more use to be honest.

    #201799
    Bruce Harman
    Participant

    I didn’t exactly get your point.
    Please Use a live demo tool like CodePen.

    #201839
    tmarkwell16
    Participant

    http://codepen.io/anon/pen/XbXWPj
    This is what I have. Is the if statement incorrect or what?

    #201840
    tmarkwell16
    Participant

    codecademy is teaching me to use prompt (for now)
    it requires that I code everything a spacific way

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.