2. Old Enough to Play?


#1



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


Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected identifier


confirm("Are you ready to play this awesome game?")
var age = prompt("What's your age");

if(age is less than 13)
{
    console.log("You are allowed to play, but creator takes no responsiblity in loss or failure")
}
else
{
    console.log("You're exactly the right age to play! Go on to the next page")
}


#2

@technut123

Sorry, in conditions in javascript we do not use english words to express it. Use symbols like <, >, ==, etc. to compare things.


#3

Thank you so much, @miniapple8888!

sillymistakes


#4

Hi! I'm having the same issue...I keep getting a syntax error message, saying there's an error before my statement. Below is what I have so far, please help!!

// Check if the user is ready to play!
confirm("I would like to play!");
Var age = prompt("What's your age?");
if(age < 13)
{
console.log("You are allowed to play, but I take no responsibility!");
}
else
{
console.log("Keep playing!!");
}


#5

you have capitalized the v in var. besides that it looks good


#6

Thanks so much for your reply!! It works!!


#7

whats wrong
here
(if age=prompt "you are older than 18 you can play"
console.log "its ok you can play next year"

var age = prompt("What's your age?");
if(age<13)
{
console.log("You are allowed to play but we have no reponsibilty ");

}
else
{
console.log("Have fun playing");

}


#8

Please what error are you getting?


#9

// Check if the user is ready to play!
confirm("I understand confirm")
ver age === prompt("What's your age")
if(age < 13)
{
console.log("You are allowed to play, but I take no responsibility!");
}
else
{
console.log("Keep playing!!");
}


#10

There was a problem with your syntax.


#11

There was a problem with your syntax.


#12

#13

You made your own topic, please wait until you get a response.