Wrong output



on entering age less than 13 the screen prints the else value which is for age that is greater than 13

confirm("are you ready to play");
var age = prompt ("what is your age");
if("age" < 13)
    console.log ("they're allowed to play but we take no responsibility")
    else {
        console.log ("play on!")


In your if condition, you put quotation marks around age and turned it into a string. Try removing them.


thanx it worked :slight_smile:


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