22.类型.html 673 B

123456789101112131415161718192021222324252627
  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. <script>
  10. var arr = new Array();
  11. var obj = new Object();
  12. var date = new Date();
  13. var num = new Number();
  14. var str = new String();
  15. var aaa = new Boolean();
  16. var num = '5';
  17. var num1 = 5;
  18. console.log(num)
  19. console.log(num1)
  20. var x = '3.1415926';
  21. // var int = new Boolean();
  22. console.log(x);
  23. console.log(parseInt(x));
  24. console.log(parseFloat(x));
  25. </script>
  26. </body>
  27. </html>