03.Boolean.html 617 B

123456789101112131415161718192021222324252627
  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. <script>
  9. /*
  10. Boolean 布尔值
  11. 布尔值只有两个,主要用来做逻辑判断
  12. true 表示真
  13. false 表示假
  14. 使用typeof检查一个布尔值时,会返回boolean
  15. */
  16. var bool=true;
  17. console.log(bool);
  18. console.log(typeof bool);
  19. </script>
  20. </head>
  21. <body>
  22. </body>
  23. </html>