Need some help with 4/7


#1

Keep getting the error

Did you declare a variable called userAnswer?

Not entirely sure what I need to do to fix it.

Here's the code.

confirm("I am ready to play!");
var age = prompt("How old are you?");
if (age <= 13){
console.log("Stop playing you scrub!");
} else {
console.log("You're awesome!");
}

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 useAnswer = prompt("Do you want to race Bieber on state?");
console.log("Cool");


#2

You called the variable useAnswer instead of userAnswer


#3

Fixed that, getting a different error now

Did you remember to console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'"); ?

Not sure what I do to fix that

confirm("I am ready to play!");
var age = prompt("How old are you?");
if (age <= 13){
console.log("Stop playing you scrub!");
} else {
console.log("You're awesome!");
}

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 state?");
console.log("Cool");


#4

Ugh. Had problems with this with another person. I wasn't able to debug it, so I will show you my code and your code, then we can compare. Don't worry: Mine is correct. :smiley: Oh yeah, it's "stage" instead of"state", though.

Mine:

confirm("Are you ready to play?")

var age = prompt("What's your age?");

if(age < 13)
{
console.log("We allow you to play, but we do not take any responsibilty.");
}
else
{
console.log("Have a happy time playing!");
}

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?");

This is yours:

confirm("I am ready to play!");
var age = prompt("How old are you?");
if (age <= 13){
console.log("Stop playing you scrub!");
} else {
console.log("You're awesome!");
}

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 state?");
console.log("Cool");


#5

Got it fixed, thank you very much. I'm not sure what went wrong but its all good now :smile:


#6

If you need explaining, I will ask others. Just say the word.


#7

I could use an explanation for what happened if you could


#8

Ohhhhh... I'm sorry I kind of slept. :smiley:

I just debugged it. You know, Codecademy is really picky about exactly copying the sentence. So what you needed to do was change

var userAnswer = prompt("Do you want to race Bieber on state?");
into
var userAnswer = prompt("Do you want to race Bieber on stage?");

ALSO

Take out the"console.log("Cool");

AND

I had to take out the " ' " into your code, after
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.' "

You see this? (') That was the problem, including the others.


#9

It worked , check this symbol (') it will work.


#10

I know what went wrong. You put less than or equal to instead of less than, and you keep making spelling errors. Like check your code before you ask on this forum.


#11

Uhhh his mangina went wrong?