title: ES6 why can I reassign a constant when defined in a loop
body: <p>I am playing around with some pointless logic to better understand ES6 and have noticed a strange occurrence when defining a constant.</p>
  
  <p>It seems possible to change a constant assignment when defined in a loop:</p>
  
  <pre><code>        "use strict";
  
          for(const i=0;i&lt;10;i++){ //seting constant in loop
              console.log(i); //is reassigned and incremented 0,1,2,3...
          }
  
  
          const e = 0; //setting constant outside loop
          for(;e&lt;10;e++){ //cannot reassign constant
              console.log(e);
          }
  </code></pre>
  
  <p>Is this expected behavior and can anyone shed some light on why this occurs, is declaration in the loop different?</p>
  
  <p><img src="https://i.stack.imgur.com/fDhe8.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>Update from <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const" rel="nofollow noreferrer">Statements/const</a></p>
  
  <blockquote>
    <p>This declaration creates a constant that can be global or local to the
    function in which it is declared. Constants are block-scoped.</p>
  </blockquote>