Stuck at Adding some story


#1

Got this code but apparently the code isnt right??

confirm("My ■■■ is sat down and i am paying attention");// Check if the user is ready to play!
var age = prompt("How old are");
if (age < 13)
{
console.log("Just about out of diapers do you want to continue?");
}
else
{
console.log("Embrace the old Grampa!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");


#2

I just tried it and it's not giving me an error. What did your error say?


#3

Oops, try again. Your code doesn't look quite right. Check the Hint if you need help!


#4

and TypeError: console.log is not a function.


#5

Yup. It is not your code. I just tried it and it works. Try a different browser or disabling any popup blocker for Codecademy.


#6

I got stuck adding a different number than number provided, so my son could play I set age to < 8 and still showed error but finally changed back to 13 and Disco! Right now stuck at

var userAnswer = prompt("Do you want to race Bieber on Stage?")
if (varAnswer === yes <=================== not sure about this part
confirm("Start your engines!");
} else {
console.log("Boo Hoooooo");
}


#7

You need check for a string and you are using the wrong variable! So you would look for "yes" . Make sure you have the quotations or it will not work! Also add a parenthesis and a curly brace at the end of the line. Then, change varAnswer to userAnswer because you set the variable userAnswer to the prompt. varAnswer does not exist in your code!

Your final result should look like:
if (userAnswer === "yes") {


#8

var userAnswer = prompt("Do you want to race Bieber on stage?")
if (userAnswer === "yes") {
console.log("Start your engines!");
} else {
console.log("Boo Hoooooo");
}
Thank You, got it!!!


#9

was the === and I had capitalized Stage, and that set the error as well, Thanks Again!


#10

Glad you got it! :slightly_smiling: Happy coding!