title: Why is a semicolon required at end of line?
body: <p>Why does this work:</p>
  
  <pre><code>a = []
  a.push(['test']);
  (function() {alert('poop')})()
  </code></pre>
  
  <p>But this gives the error "number is not a function":</p>
  
  <pre><code>a = []
  a.push(['test'])
  (function() {alert('poop')})()
  </code></pre>
  
  <p>The only difference is the semicolon at the end of line 2. I've been writing JavaScript for a long time now. I know about automatic semicolon insertion, but I can't figure out what would be causing this error.</p>