cannot access function before initialization js

JavaScript
function test(){
   let foo = 33;
   if (true) {
      foo = (foo + 55);
   }
}
test();
 Cannot access 'stats' before initialization
 
Source

Also in JavaScript: