Javascript - Write program to Write an if/else statement

Requirements

Write an if/else statement with the following condition:

If the variable age is greater than 18, output "Old enough", otherwise output "Too young".

var age = 25;

// Add the if/else statement here

Hint

if (condition) {
   block of code to be executed if the condition is true
} else {
   block of code to be executed if the condition is false
}

Demo

var age = 25;

if (age > 18) {
    console.log( "Old enough" );
} else {//from  w  w  w. j  ava  2  s. c  om
    console.log( "Too young" );
}

Result