I stuck on this. Don't know what to do? Whatever the value i give 0 or 1 it always goes to else condition print.help me out?


Help me out


Answer is same for what is choose. either yes or no in the condition.

// Check if the user is ready to play!
confirm("Yes I am ready")
var age = prompt("What is your age?");
if(age < 13)
console.log("under age, SORRY");    
        console.log("welcome to our kingdom");
        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");
            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.");


= one equal sign means assign
=== checking if its the same

Go like this
userAnswer === "yes"
then type in yes and see it will work :slight_smile:


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