Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
33
rated 0 times [  35] [ 2]  / answers: 1 / hits: 27895  / 11 Years ago, sat, february 1, 2014, 12:00:00

I am learning Javascript via Codecademy and no have been stumped on this little piece here.



I have supposed to write an if else statement.



It shows me here in the following that there is a Syntac Error with a missing identifier:



var userAnswer = prompt(Are you feeling lucky, punk?);

if (userAnswer === yes);
{

console.log(Batman hits you very hard. It's Batman and you're you! Of course Batman wins!);
}

else {

console.log(You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.);
}


What is wrong with that.... There is no error in this example here:



if (age < 18)

{

console.log(We take no actions or responsibility. Play at your own risk!);
}

else

{

console.log(Enjoy the game);
}

More From » identifier

 Answers
7
if (userAnswer === yes);


Remove the semicolon.


[#72799] Thursday, January 30, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dayshadelaniej

Total Points: 668
Total Questions: 121
Total Answers: 121

Location: Sao Tome and Principe
Member since Wed, Dec 21, 2022
1 Year ago
;