title: Are variables declared with let or const hoisted?
body: <p>I have been playing with ES6 for a while and I noticed that while variables declared with <code>var</code> are hoisted as expected...</p>
  
  <pre><code>console.log(typeof name); // undefined
  var name = "John";
  </code></pre>
  
  <p>...variables declared with <code>let</code> or <code>const</code> seem to have some problems with hoisting:</p>
  
  <pre><code>console.log(typeof name); // ReferenceError
  let name = "John";
  </code></pre>
  
  <p>and</p>
  
  <pre><code>console.log(typeof name); // ReferenceError
  const name = "John";
  </code></pre>
  
  <p>Does this mean that variables declared with <code>let</code> or <code>const</code> are not hoisted? What is really going on here? Is there any difference between <code>let</code> and <code>const</code> in this matter?</p>