Syntax error. Expected ")"


#1
// Check if the user is ready to play!

confirm("I am ready to play!");
var age = prompt("What's your age?");
if (age is < 13)
{
console.log("You can play but I take no responsibility for warping your tiny mind");
}
else (age is => 13)
{
console.log("Play away my friend!");
}

Any ideas please guys? My brain hurts...


#2

Hey @scottbelbin! Remember this is not english :laughing:

So this is the if statement:

  if (age < 13){

console.log("You can play but I take no responsibility for warping your tiny mind");
}
else {
console.log("Play away my friend!");
}
Your not suppose to have a condition in your else statement, an else statement is like anything else.

The code is saying: If age is less than 13 then log "You can play but I take no responsibility for warping your tiny mind" ELSE log "Play away my friend!" Understand?


#3

I'm really sorry, my 5am start is catching up with me, and I'm afraid I don't.

// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age?");
if (age is < 13)
{
    console.log("You can play but I take no responsibility for warping your tiny mind");
}
else (age is => 13)
{
    console.log("Play away my friend!");
}

#4

You understand now??...


#5

Ah, I see now! Unfortunately, that has not resolved the issue. Below is the code I currently have:

// Check if the user is ready to play!

confirm("I am ready to play!");
var age = prompt("What's your age?");
if (age is < 13)
{
console.log("You can play but we take no responsibility for warping your tiny mind");
}
else
{
console.log("Play away my friend!");
}


#6

That is not correct. Trust me you cant just say:

If you had a check from that, that is a :bug: from codecademy.


#7

Ok, what would you advise to make this code correct?


#8

change that to

And then it would be correct


#9

THANK YOU!!! Appreciate your help