6.运算.html 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. 1.和 &&:都为真时才为真,一方为假则为假
  14. 2.或 ||:一方为真则为真,都为假时才为假
  15. 3.非 !:返回的是否定值 相反值
  16. -->
  17. <script>
  18. /**
  19. * = 赋值
  20. * == 强制转换 相等
  21. * === 完全相等
  22. */
  23. var a = 21;
  24. var b = a;
  25. console.log(b);
  26. if(a === '21') {
  27. console.log("成功")
  28. }
  29. console.log(2<3 || 5<4); // true
  30. console.log(2>3 || 5<4); // false
  31. console.log(2<3 && 5<4); // false
  32. console.log(2<3 && 5>4); // true
  33. console.log(5!=2);//true
  34. console.log(5!=5);//false
  35. </script>
  36. </body>
  37. </html>