JavaScript: Assign an object to another object
<p>I'm trying to assign the local var <code>UgcItems</code> to <code>uploadedItems</code> but when I try to return the value I get <code>undefined</code>.  If I put the <code>console.log</code> inside of the <code>.getJSON</code> then I get the appropriate value.  The problem with that is that the scope is inside of the function.  What can I do to get the JSON out of the function?</p>

<pre><code>$(function(){
    var uploadedItems;
    $.getJSON("GetExistingUgcItems?workItemId=1", function (UgcItems) {
        uploadedItems = UgcItems;
    });

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

<p>Thank you,</p>

<p>Aaron</p>
