SOURCE

//不能穿透大括号
//没有变量声明提升


function f() {
  {
    let x;
    //console.log(x);
    {
      console.log(x);
      // this is ok since it's a block scoped name
      let x = "sneaky";
      console.log(x);
      // error, was just defined with `const` above
     // x = "foo";
     // console.log(x);
    }
    // this is ok since it was declared with `let`
    x = "bar";
    console.log(x);
    // error, already declared above in this block
    //let x = "inner";
    console.log(x);
  }
}

f();
console 命令行工具 X clear

                    
>
console