var i = 5; // j的临时性死区
(function hh() {
var i
console.log(i) // undefined
i = 10
})() // j的临时性死区
// j的临时性死区
let j = 55; // 接下来可以愉快的使用let了
console.log(j)
console.log(j+10)
(function hhh() {
console.log(j) // 新的j的临时性死区
let j = 77 //又有一个声明语句,从这个函数的开始部分到这里,都是新的j的临时性死区
})()
const a = 1
a = 2 // Uncaught TypeError: Assignment to constant variable.
const b = '1231'
b = 'xcv' // Uncaught TypeError: Assignment to constant variable.
const c = true
c = false // Uncaught TypeError: Assignment to constant variable.
console