SyntaxError: missing ) after argument list


#1

I don't get what's wrong? This is my code:

confirm("Are You Ready To Play?" )
var age = prompt("What's your age" )
if ( age < 13 ) {
console.log ( confirm "You can play but I take no responsibility" )
} else {
console.log(confirm"Go on! You can do it! Play on!")
}

I don't get it... HELP ME PLS
I know its around "if ( age < 13 )"


#2

Add a semi-colon at the end.

This is the main confusion to the interpreter:

The confirm. Please delete.

Hope this helps! :slight_smile:


#3

Sorry the that's not it but still thanks for the help :slight_smile:


#4

Remove the confirm on both lines.


#5

THANKS FOR THE HELP !!!
THAT WAS IT !!!
I COULDN'T HAVE DONE IT WITHOUT YOU !!!
:slight_smile::grinning::grin::smiley::smile::relaxed:


#6

You're welcome.

I'm glad I could help.

Have fun coding! :slight_smile:


#7

Here is the problem, Instead of doing that you should do:
} else {
console.log("Go on! You can do it! Play on!");
}


OR

} else {
alert("Go on! You can do it! Play on!");
}

depends on what you were asked to do in the instructions. Hope I helped you. Good luck!


#8

Hello,
I have a problem with this code, can you help me?:slight_smile:

confirm("are you ready to play?");
var age = prompt("what's your age");
if (age < 38) {
console.log("you are very cool");
}
else
{
console.log("you are a baby!");
}

Thanks!


#9

I don't see anything wrong with your code. But here, add a question mark and put the w in CAPS, just like below to the string.

var age = prompt("What's your age?");

Hope I helped! :slight_smile:


#10

Hello,
Thanks for your help but it doens't work;(

confirm("Are you ready to play?");
var age = prompt("What's your age?");
if (age < 38) {
console.log("you are very cool");
}
else
{
console.log("you are a baby!");
}

any idea?
Thanks a lot


#11

The instruction says to:

Then write an if/else statement. If age is less than 13

if (age < 13)

#12

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