Can't access global array in JavaScript
<p>I have a global variable say :</p>

<pre><code>var series,hours;
var loadData = function(){
series = [[]];
hours = [];
d3.json("data/radar.json", function(error, data) {

    data.QualitySummaryObject.forEach(function(d,i) {
        series[i] = d.extractPercentage;
        hours[i] = d.extractorName;
  });


});  
console.log(hours);
};
</code></pre>

<p>Now if I am trying to access this console.log its working fine, but.</p>

<pre><code>var print = function(){
    console.log(hours); //here its not working no value in hours why ... ?
}
</code></pre>
