title: JavaScript function data handling
body: <p>I'm newbie to javascript and I need to now one small thing.
  I have this code</p>
  
  <pre><code>http.get(options, function(res) {
      res.setEncoding('utf-8')
      res.on('data', function (chunk) {
          var parser = new xml2js.Parser();
          if(chunk.length &lt; 50) {
              console.log('end!');
          } else {
              console.log(chunk);
          }
      });
  })
  </code></pre>
  
  <p>And I need to operate with variable "chunk" in the rest of code. How I can throw it from the function? - stadart return will not work here of course.</p>