title: Twitter API and Node
body: <p>I'm trying to retrieve my last tweet from Twitter with <a href="https://github.com/jdub/node-twitter" rel="nofollow">https://github.com/jdub/node-twitter</a></p>
  
  <p>I want to declare a variable, change that variable within a function, then use it again outside that function. Is this possible?</p>
  
  <p>I have authenticated and can see my last tweet if I do:</p>
  
  <pre><code>var tweet;
  
  twit.get('http://api.twitter.com/1/statuses/user_timeline.json', function(data) {
      tweet = data[0].text;
      console.log(tweet);
  });
  </code></pre>
  
  <p>But I want to separate my code out and do:</p>
  
  <pre><code>var tweet;
  
  twit.get('http://api.twitter.com/1/statuses/user_timeline.json', function(data) {
      tweet = data[0].text;
  });
  
  console.log(tweet);
  </code></pre>
  
  <p>Tweet is still undefined.</p>
  
  <p>Please educate me :-)</p>