var funcs = []
[1, 2].forEach( (i) => funcs.push( () => i ) )
Why does it produce the error below?
TypeError: Cannot read property 'forEach' of undefined
at Object.<anonymous>
However, the error goes away if the semicolon ;
is added to the end of the first line.