title: Javascript global scope with const vs var
body: <pre><code>var name = 'John';
  
  console.log(this.name, document.name, window.name, name);
  
  const meme = "Bruce";
  
  console.log(this.meme, document.meme, window.meme, meme);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>John undefined John John
  undefined undefined undefined "Bruce"
  </code></pre>
  
  <p>Is global scope differently defined for var and const? I thought the only difference would be the const is immutable.</p>