Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Typical Conditional Statement</title> </head> <body> <script> var userType; var age = 21; if(age < 18) { userType = 'Child'; } else { userType = 'Adult'; } document.write(userType); // Prints Adult </script> </body> </html>