12345678910111213141516171819202122232425262728293031323334353637 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- //声明变量 不能重复
- let a;
- let b,c,d;
- let e = 100;
- let f = 521,g = 'hi', h = {};
- //块级作用域
- // if else while for
- //{
- // let a = 'c';
- //}
- //不存在变量提升
- //console.log(hello);
- //let hello = 'a';
- //不影响作用域链
- {
- let school = 'hi';
- function aa(){
- console.log(school)
- }
- aa();
- }
- </script>
- </body>
- </html>
|