title: How to pass the value in `hgetall` out in node.js
body: <p>I use redis, and here are my codes</p>
  
  <pre><code>const redis = require("redis"), client = redis.createClient()
  let count1, count2, countall
  client.hgetall('onekey', function(err, object) {
    if (object) {
      count1 = object.onevalue
      console.log(count1)
    } else {
      count1 = 2
    }
    client.quit()
  })
  client.hgetall('twokey', function(err, object) {
    if (object) {
      count2 = object.twovalue
      console.log(count2)
    } else {
      count2 = 3
    }
    client.quit()
  })
  countall = count1 + count2
  console.log(countall)
  </code></pre>
  
  <p>I run this code, and I can get the results of <code>count1</code> and <code>count2</code>, but <code>console.log(countall)</code> shows <code>undefined</code>, I don't why, how can I pass the value to out of the function block? Many thanks</p>