Javascript - Write program to Use a conditional (ternary) operator

Requirements

Write program to Use a conditional (ternary) operator

If the variable age is a value below 18, the value of the variable voteable should be "Too young",

Otherwise the value of voteable should be "Old enough". Syntax hint: (condition) ? value1:value2;

var age = 20;
var voteable = // add code here
console.log( voteable + " to vote.");

Demo

var age = 20;
var voteable = (age < 18) ? "Too young":"Old enough";
console.log( voteable + " to vote." );

Result