<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>三元运算</title> </head> <body> <script type="text/javascript"> var a = 4; var b = 5; var c = a < b ? a : b; //alert(c); var num; alert(num); var d = 0==0 ? a : b; alert(d); </script> </body> </html>