7_运算3.html 365 B

1234567891011121314151617
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <script>
  11. var a = 6
  12. console.log(a>5?a:-a)
  13. //三目运算符 判断条件?true:false
  14. </script>
  15. </body>
  16. </html>