title: console.log printing statements in the wrong order for learnyounode node.js tutorial
body: <p>I'm making a <code>GET</code> request, storing the data, and then noting the response is over.  I have one <code>console.log</code> statement for when I'm done receiving the data and another for when the program has finished.  See below:</p>
  
  <pre><code>var a = 1
  var b = 10e9
  
  http.get(process.argv[2], function(response){
    response.pipe(bl())
    response.on('end', function(){
      console.log("Finished receiving data")
    })
  })
  
  while(a != b){
    a++
  }
  
  console.log("Program has finished")
  </code></pre>
  
  <p>In this case, I would expect the order of the print statements to be </p>
  
  <pre><code>Finished receiving data
  Program has finished
  </code></pre>
  
  <p>because I would expect the end of the response to occur before the <code>while</code> loop terminates.  However, regardless of whether that loop is 1 to 2 or 1 to 100000000000, I always get </p>
  
  <pre><code>Program has finished
  Finished receiving data
  </code></pre>
  
  <p>Why are the print statements happening in this order?</p>