hoist for var, let, const, function, function*, class

I have been playing with ES6 for a while and I noticed that while variables declared with var are hoisted as expected… console.log(typeof name); // undefined var name = “John”; …variables declared with let or const seem to have some problems with hoisting: console.log(typeof name); // ReferenceError let name = “John”; and console.log(typeof name); //…