How do I add items to an array in JQuery
<pre><code>var list = [];
$.getJSON("json.js", function(data) {
    $.each(data, function(i, item) {
        console.log(item.text);
        list.push(item.text);
    });
});
console.log(list.length);
</code></pre>

<p>list.length always returns 0.  I've browsed the json in firebug and it well formed; everything looks fine.  I just can't seem to add an item to the array.  What am I missing?</p>

<p>Thanks,
Nathan</p>
