Telling me I didn't print out the intro


#1


Code Your own Adventure - Adding some story


I don't know what I am doing incorrectly. also my if/else is misbehaving. I put in my age as 24 and it still outputs the true command.

It's telling me that I haven't printed the intro. It is showing up in the viewer.


// Check if the user is ready to play!
confirm("I am ready to play!")
var age = prompt("What's your age");
if ("age < 13") {
    console.log("You may continue, however we take no responsibility for any trauma you may experience.");
}
else {
    console.log("Have fun!");
}

console.log ("You are at a Justin Beiber concert, and you hear this lyric 'Lace my shoes off, start racing.'");


#2

hello @otiswillis

This is a string, a non empty string is considered as true boolean value when evaluated.
so it will always runs the if part.

erase the quotes and try again?
If you get confusion,point them out.


#3

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