2. Old enough to play. I don't know what to do


// Check if the user is ready to play!
confirm("I understand confirm!");
var age = prompt("What's your age");

Can anyone help?


Here are the instructions for the lesson: 1.) Under the existing code, declare a variable age.
2.) Make age equal to prompt("What's your age");. See the example above.
3.) Then write an if/else statement. If age is less than 13, use console.log to tell the user that they're allowed to play but you take no responsibility.
4.) Else, use console.log and give them an encouraging message to play on!
You have the first step and second step complete! Good job! Now we need to complete the other steps! Here is a basic outline for completing Steps 3 and 4:

if (age comparison statement)
console.log (what you can put here)
console.log (what you can put here)


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