Help... Old enough?


I have completed this exercise however there is something that just bothers me. No matter the age I input the else message of "please enjoy the game" always shows whether age is greater than or less than 13. I can't figure out why it is doing this. Codeacademy says I have completed the exercise but I feel like I haven't until I can get only the correct message to play and not the other one.

 // Check if the user is ready to play!
confirm ("Hit ok if you are ready to play");
var age = prompt ("What's your age");
if (age <= 13) 
    console.log ("You may play, but I hold no responsibility. Please enjoy the game");
else (age > 13); 
    console.log ("Please enjoy the game");


if/else statement,
if must have a conditional expression but else goes without any conditional expression.

It simply catches all counter cases of if- block conditions so we don't need one for else.


Ah, thank you very much


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