title: How does node.js http.get() "on(end,callback())" event works?
body: <p>My question is: How does the "http.get()", on.("end",callback) event work?</p>
  
  <p>What is the hierarchy of the code execution?</p>
  
  <p>I'm asking because I have this code </p>
  
  <pre><code>var http = require("http")
  var str = ""
  
  http.get(process.argv[2],function(res){
      res.setEncoding("utf8")
      res.on("data",function(data){
          str+= data
  
      })
  
      res.on("end",function(){
          console.log(str.length)
          console.log(str)
  
  
      })
  
  })
  </code></pre>
  
  <p>is the <code>on.end</code> part would print me the str.length every time its called?</p>