Please help


#1

It keeps saying " It looks like you didn't check for the user's age."

confirm ("You gonna play?")

var age = prompt("Whats's your age");

if(age < 16)
{
console.log("Goodbye")
}
else
{
console.log("Play")
}


#2

@mattpalmer
After your confirm ("You gonna play?") , console.log("Goodbye")and console.log("Whats's your age") , be sure to put a semicolon ; in order for the code to execute. Semicolon determines the end of an instruction in JavaScript. Make sure when you're writing prompt("Whats's your age"), you put prompt("What's your age?") instead. Hope this helped you.


#3

This is what I have now:
confirm ("You gonna play or not?");

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

if(age < 16)
{
console.log("Goodbye");
}
else
{
console.log("Play")
}
It still says "It looks like you didn't check for the user's age."


#4

@mattpalmer
Look at your console.log("Play"), it should have a semicolon at the end of it. Each instructions should end with a semicolon.


#5

still not working same message pops up


#6

@mattpalmer
In the exercice, it ask you to put an if/else condition on whether the user is 13 year old and more or not. Here, you have written whether he is 16 years old.


#7

oohhh thanks alot man


#8

In JavaScript, some lines of code such as console.log's do not need a semicolon at the end of it. However, it is a really good habit to have. Many programming languages (for example: Java) need to have semicolons at the end of print lines (such as this: System.out.println("Hi"); ) for it to successfully run.