#4 - Bieber Console.log error


#1



Hello everyone, I can't figure out what I am doing wrong... thank you!

https://www.codecademy.com/en/courses/javascript-beginner-en-x9DnD/0/4?curriculum_id=506324b3a7dffd00020bf661


"Opps, try again did you remember console.log "Suddenly, Bieber stops and says,'Who wants to race me?"


// Check if the user is ready to play!
confirm("Are you ready to play?")
var age = prompt ("How old are you?")
if(age < 13)
console.log("Please get permission");
else
console.log("Good Luck!");
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 wan to race Bieber on stage?");


#2

Hi your if and else statement shoud have that structures

if (condition) {
    #do something
}
else {
    #do something 
}

#3

There is a problem with the output message you need to add a space before 'Who ...

@wizmarco That's is actually ok (omitting the {}) if only one statement is following. Although it looks better and is easier to read with formatting and braces.


#4

Thank you, but that did not help the issue. Also, the previous statement did not have a space between ' and Lace...


#5

You should put the space before the ' like that

says, 'who.....

#6

It is weird because when I remove the var userAnswer Statement - it asks me for that, not the console.log error.


#7

AH that was it! Thank you!


#10

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