This is the example:
function b() {
  console.log(f); 
  {
    function f() {}
  }
}
b()I thought it would become:
function b() {
  // hoist to function scope
  function f() {}
  console.log(f); // should output function f
}
or
function b() {
  console.log(f); // should output reference error
  {
     // just hoist to block scope like this
     function f() {}
  }
}
but it outputs undefined, like var hoisting. why?
 
     
     
     
    