Way2tutorial Snippet Editor
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JavaScript Ternary Operator</title> </head> <body> <pre> <script type="text/javascript"> document.write((10 == 10) ? "Same value" : "different value"); </script> </pre> </body> </html>