title: Error calling forEach on an array literal in javascript
body: <p>This code generates an error when I run it with node v6.9.2</p>
  
  <pre><code>var req = {}
  
  ['foo', 'bar'].forEach(prop =&gt; {
      console.log("prop: " + prop)
  });
  </code></pre>
  
  <p>The error is: <code>TypeError: Cannot read property 'forEach' of undefined</code></p>
  
  <p>Why would that be? There doesn't seem to be anything syntactically wrong with what I'm doing. I note that if I add a semi-colon after the <code>var req = {}</code> line the error disappears, but I still don't understand why since I thought semi-colons were optional in JavaScript as long as each statement was on a separate line.</p>