Age confirm


#1


i just began and i got stuckkk... help!
so this happened on exercise 2
https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/2?curriculum_id=506324b3a7dffd00020bf661#


after prompting my age (as excpected)
and the console shows the phrase i wanted (as expected)...
still it doesn't let me through to the next lesson.
Instead it says :

Oops, try again. It looks like you didn't check for the user's age.

here's my code:


confirm ("Let's play and get smart!");

var age = prompt ("How old are you?");

if (age <= 16) {
    console.log ("Let's do this!");
    }
    else {
    console.log ("This is a kid zone, no adults please!");
    }

anyone?
thanks before!


#2

I think you need to say if the user is less than 13 rather than less or equal to 16.


#3

silly mistake.
thanks!


#4

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