title: global variable in javascript not working; loses data
body: <pre><code>var feed;
  $.getJSON('short.json', function(data) {
      feed = data.items;
      console.log(feed);
      });
  console.log(feed);
  </code></pre>
  
  <p>I have this short code written above. I am expecting feed to be a global variable but once it comes out the function, it's undefined again. It prints out an object when inside. What am I doing wrong?</p>
  
  <p>Thanks for the help.</p>