title: Why does `var exports = module.exports = {};` works but not `let exports = module.exports = {};`?
body: <p>During code optimisation of my project, I was replacing all instances of <code>var</code> keyword with <code>let</code> because I think there is no particular use left for <code>var</code>. I did a 'Find &amp; Replace' in all files to do this.</p>
  
  <p>In some custom modules I had used statements like:</p>
  
  <pre><code>var exports = module.exports = {};
  </code></pre>
  
  <p>which worked fine.</p>
  
  <p>Now, after replacing it with <code>let</code>, it became:</p>
  
  <pre><code>let exports = module.exports = {};
  </code></pre>
  
  <p>It does not work now and gives an error </p>
  
  <blockquote>
    <p>SyntaxError: Identifier 'exports' has already been declared</p>
  </blockquote>
  
  <p>Though I can use <code>var</code> and avoid this problem, I still want to know what is the reason behind this.</p>
  
  <p><strong>EDIT:</strong> I have not used <code>let exports = &lt;something&gt;;</code> anywhere in same module file. So this is the only statement where I have declared <code>exports</code> variable.</p>