title: NodeJS + redis gives weird results
body: <p>Maybe the results ain't weird, but I started using Node 1-2 months ago so for me they are...</p>
  
  <p>I have a loop which sorts out every other value of the array returned by <code>hgetall</code> (Redis command) and in that loop I call a function to get all values from another table with keys stored in the sorted array. This was more difficult to explain than I thought. Here's my code:</p>
  
  <p>Pastebin: <a href="http://pastebin.com/tAVhSUV1" rel="nofollow">http://pastebin.com/tAVhSUV1</a> (or see below)</p>
  
  <pre><code>function getInfo (cn, callback) {
          var anArray = [];
          redis_client.hgetall('chat_info:' + cn, function (err, vals) {
                  if(err) { throw err; }
                  for(i in vals) {
                          anArray.push(vals[i]);
                  }
                  return callback(anArray);
          });
  }
  
  redis_client.hgetall('chat_rooms:' + POST.chat_name, function (err, val) {
          if(err) { throw err; }
          var     vars = [],
                  rArr = [];
  
          for (i in val) {
                  vars.push(i);
          }
          for(var i = 0; i &lt; vars.length; i += 1) {
                  if(i%2 === 0) {
                          getInfo(vars[i], function (hej) {
                                  rArr.push(hej);
                          });
                  }
          }      
  });
  </code></pre>
  
  <p>The callback from the call to <code>getInfo()</code> is executed after the entire loop. Am I missing out on something here? Because it can't do that, right? (when I use rArr (right after the loop) it's empty, nbBut if I log it in the callback it gets logged after everything else written <em>after</em> the loop)</p>