Code Your Own Adventure: First Move! JavaScript


#1



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

TypeError: prompt is not a function


confirm("Are you ready to play?");
var age = prompt("What's your age");
if(age < 13)
{
    console.log("You may proceed, but we take no responsibility for the graphic content you will see");
}
else
{
    console.log("Game on!");
}
{
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 Justin Bieber on stage?")


#2

First off, you forgot a semi-colon.

I suggest you remove the brackets from the console.log statements.


#3

Still didn't work
{
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
}
Oops, try again. There was a problem with your syntax.
SyntaxError: Invalid or unexpected token


#4

Try removing the { and } that surround the console.log statement


#5

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?'");
Oops, try again. There was a problem with your syntax.
SyntaxError: Invalid or unexpected token


#6

I don't know what I did, I just added a space in between the 2 console logs and refreshed the page and it worked.


#7

Congrats. I couldn't, for the life of me, figure out what was wrong with your code.


#8

Ye, it was probably google being dumb


#9

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