title: ECMAScript 2015: const in for loops
body: <p>Which of the two (or neither/ both) code fragments below should be working in a complete ECMAScript 2015 implementation:</p>
  
  <p><code>for (const e of a)</code></p>
  
  <p><code>for (const i = 0; i &lt; a.length; i += 1)</code></p>
  
  <p>From my understanding, the first example should work because <code>e</code> is initialized for each iteration. Shouldn't this also be the case for <code>i</code> in the second version?</p>
  
  <p>I'm confused because existing implementations (Babel, IE, Firefox, Chrome, ESLint) do not seem to be consistent and have a complete implementation of <code>const</code>, with various behaviours of the two loop variants; I'm also not able to find a concrete point in the standard, so that would be much appreciated.</p>