1_新的变量定义关键字.html 634 B

123456789101112131415161718192021222324252627282930313233343536
  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 a = 10;
  11. // var a = 20;
  12. // b = 10;
  13. // var b;
  14. // let a = 10;
  15. // var a = 10;
  16. // console.log(window.a);
  17. // let b = 20;
  18. // console.log(window.b);
  19. // const c = 30;
  20. // console.log("hello");
  21. let a = 10;
  22. a = 20;
  23. console.log(a);
  24. const b = 20;
  25. b = 30;
  26. console.log(b);
  27. </script>
  28. </body>
  29. </html>