Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Ternary Operator</title> </head> <body> <script> let age = 21; let userType = age < 18 ? 'Child' : 'Adult'; document.write(userType); // Prints Adult </script> </body> </html>