index.html 792 B

12345678910111213141516171819202122232425262728293031323334353637
  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. </head>
  9. <body>
  10. <script>
  11. //声明变量 不能重复
  12. let a;
  13. let b,c,d;
  14. let e = 100;
  15. let f = 521,g = 'hi', h = {};
  16. //块级作用域
  17. // if else while for
  18. //{
  19. // let a = 'c';
  20. //}
  21. //不存在变量提升
  22. //console.log(hello);
  23. //let hello = 'a';
  24. //不影响作用域链
  25. {
  26. let school = 'hi';
  27. function aa(){
  28. console.log(school)
  29. }
  30. aa();
  31. }
  32. </script>
  33. </body>
  34. </html>