Unexpected identifier! plz help


#1

Unexpected end of input

var age = prompt("What's your age?")
if(age < 13){
console.log("You are allowed to play, but I take no responsibility if you die.")

} else {
 (age >= 13)
    console.log("Let's go!!!")
    console.log("Are you ready?")
    console.log("As you stand there in the GameStop parking lot, you can't decide whether or not to go inside.")
    var Answer = prompt("Go inside?")
    if (Answer === "Yes"){
        ("You walk inside, and to your surprise, it's empty! You line up and buy your game.")
    } else { console.log("THE END.")
       
    prompt("Did you like it?")
    if (Answer === "Yes"){
    console.log("Cool.")
    } else {
    console.log("Oh.OK.") ; 
    };

#2

Unexpected end of input generally means you have a misplaced semicolon, opening or closing. In this case after you log "THE END" and prompt the user, you never close that else statement. Add a closing curly brace before the next if statement.


#3

Thanks, but now after I fixed that error it is saying 'Unexpected Identifier.'

var Answer2 = "No"
var age = prompt("What's your age?")
if(age < 13){
console.log("You are allowed to play, but I take no responsibility if you die.")

} else {
(age >= 13)
console.log("Let's go!!!")
console.log("Are you ready?")
console.log("As you stand there in the GameStop parking lot, you can't decide whether or not to go inside.")
var Answer = prompt("Go inside?")
if (Answer === "Yes"){
("You walk inside, and to your suprise, it's empty! You line up and buy your game.")
} else { (Answer2 === "No") console.log("THE END.")
}
prompt("Did you like it?")
if (Answer === "Yes"){
console.log("Cool.")
} else { (Answer2 === "No")
console.log("Oh.OK.") ;
};


#4

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