Return array from JSON file with JQuery?
<p>I have a JSON file that contains the following:
[{name:joe,number:4},{name:ralph,number:76}]</p>

<p>Simply put, I'm trying to create a function that returns that as an array:</p>

<pre><code>function createArray(){
    x = $.getJSON("/names.json", function(json) {
        var myArray = [];
        $.each(json, function() {   
            myArray.push(json);
        });
        return myArray;
    });
    return x;
}
</code></pre>

<p>This is not working, I'm not sure what part of it doesnt make sense</p>
