×
×
Correct!

Choose the correct conditional (ternary) operator to alert "Too young" if age is less than 18, otherwise alert "Old enough".

var age = n; var voteable = (age < 18) ? "Too young" : "Old enough"; alert(voteable);

Not Correct

Click here to try again.

Correct!

var age = n;
var voteable = (age  18)  "Too young"  "Old enough";
alert(voteable);

  
  
  




×

Reset the Score?

This will reset the score of ALL 67 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 67 JS exercises.

Share your score:



Get Certified!

Take our JavaScript Developer Certificate to prove that you have fundamental knowledge of web development using JavaScript.