title: Getting an error when using concat in casperjs
body: <p>Here's my code:</p>
  
  <pre><code>var elements = [];
  var casper = require('casper').create();
  
  function getElements() {
     var elements = document.querySelectorAll('ol.nav-primary &gt; li &gt; a');
     return Array.prototype.map.call(elements, function(e) {
          return e.getAttribute('class');
     });
  }
  
  casper.start('URL', function() {
     this.waitUntilVisible('ol.nav-primary');
     casper.then(function() {
         this.echo("Nav bar is visible");
     });
  });
  
  casper.then(function() {
     elements = this.evaluate(getElements);
  });
  
  casper.then(function() {
     elements = elements.concat(this.evaluate(getElements));
  });
  
  casper.run(function() {
     this.echo(elements.length + ' elements found:');
     this.echo(' - ' + elements.join('\n - ')).exit();
  });
  </code></pre>
  
  <p>When I run the test, this is the error I'm getting:</p>
  
  <pre><code>TypeError: 'null' is not an object (evaluating 'elements.concat')
  </code></pre>
  
  <p>I'm just trying to write a simple script to run through and grab a list of classes to utilize in future automated tests. I basically utilized the exact code that casperjs uses as a script to scrape google and return links pulled up in a search. </p>
  
  <p>I do not know why this error is coming up though.</p>