Assigning variable or array to object element in javascript
<p>I've got something like this which works, but I want to use the <code>result2</code> array for the first series<code>.data</code> rather than hardcoding. Using <code>data: result2</code> or <code>data: [result2]</code> does not work. Is it not possible to assign with a variable in this kind of declaration?</p>

<pre><code>var chart1;
$(document).ready(function() {
  $.get('sales_data', function(result) {
      var result2 = result.split(',');
      chart1 = new Highcharts.Chart({
         series: [{
            type: 'column',
            name: 'Units',
            data: [1, 3, 4]
         }, {
            type: 'line',
            name: '3 month avg',
            data: [2, 3, 4]
         }]
      });
   });
});
</code></pre>
