1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <!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>
- /*
- const
- 1、不能重复声明
- 2、没有变量提升
- 3、临时失效区
- 4、块级作用域
- */
- // const a = 100;
- // console.log(a)
-
- // const a = 100
- // a = 200
- // console.log(a)
- // console.log(a)
- // const a = 100
- // const a = 100
- // function fn(){
- // console.log(a)
- // const a = 10
- // }
- // fn()
- var a = true
- if(a){
- const x = 100
- }
- console.log(x)
- </script>
- </body>
- </html>
|