Cannot read property 'forEach' of undefined
<pre><code>var funcs = []
[1, 2].forEach( (i) =&gt; funcs.push( () =&gt; i  ) )
</code></pre>

<p>Why does it produce the error below?</p>

<pre><code>TypeError: Cannot read property 'forEach' of undefined
    at Object.&lt;anonymous&gt;
</code></pre>

<p>However, the error goes away if the semicolon <code>;</code> is added to the end of the first line.</p>