title: Dealing with slow callback functions
body: <p>When getting data from a text file, it seems to take a while. With the first console.log the result is undefined, after waiting some time and then running console.log the data shows.</p>
  
  <pre><code>var msg;
  $.get("./whazzup.txt", function(text) {
    msg = text;
  });
  console.log(msg);
  setTimeout(function(){ console.log(msg); }, 3000);
  </code></pre>
  
  <p>How would I go about only running code once the callback is complete?</p>