6.运算.html 833 B

123456789101112131415161718192021222324252627282930
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <!--
  10. 关系运算符 > < = >= <=
  11. 逻辑运算符
  12. || 或 两方只要有一方是真 则为真;两方为假 才为假
  13. && 和 两方都为真 才为真;一方为假 则为假
  14. ! 非 取相反值 与等于号使用时=>不等于
  15. -->
  16. <script>
  17. // console.log(2<3 || 5<4);
  18. // console.log(2<3 || 1<4);
  19. // console.log(2>3 || 1>4);
  20. // console.log(2<3 && 5<4);
  21. // console.log(2<3 && 1<4);
  22. // console.log(2>3 && 1>4);
  23. console.log(!true);
  24. console.log(!0)
  25. console.log(5!=2)
  26. </script>
  27. </body>
  28. </html>