I cant seem to get past .3 adding some story


#1


keeps saying SyntaxError: Unexpected token ILLEGAL


// Check if the user is ready to play!
confirm("ready to play?");

var age = prompt("what is your age");

if ( age < 13)
{
console.log("you are not allowed to play")
}

else 

{
console.log(" YAY you are old enough, continue to play);
}

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


#2

There is an unclosed string here:

console.log(" YAY you are old enough, continue to play);

You have to close it with ".


#3

Thanks ! That funny that i could move on even with that mistake ? also didnt solve my problem :confused:


#4

i fixed it, i had put print in my code trying to figure out why it wouldnt work :smiley: now ive deleted it everything works fine ! thanks


#5

That funny that i could move on even with that mistake ?

Codecademy assumes that when you see the error in the console you will know that your code is not correct and you will try to fix it. We can't force anyone to learn :slight_smile:

also didnt solve my problem :confused:

Oh, you are right. print statement does not exist in JavaScript. To print something you only need console.log, nothing more:

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

#6

do you see anything wrong with this

// Check if the user is ready to play!
confirm("ready to play?");

var age = prompt("what is your age");

if ( age < 13)
{
console.log("you are not allowed to play")
}

else

{
console.log(" YAY you are old enough, continue to play");
}

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

If (UserAnswer ==="yes")
{
console.log( "You and Bieber start racing. It's neck and neck! You win by a shoelace!" );
}
else
{
console.log ( "Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'" );
}


#7

If and UserAnswer should be lowercase here:

If (UserAnswer ==="yes")

#8

gah the little things lol thanks


#9

Everything is important in programming :slight_smile: You're very welcome.


#10

well thanks ! with your help i just finished programming my first "game" :joy:


#11

That's a start! Few months / years and you will work on the next Battlefield.

Glad I could help :slight_smile:


#12

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