title: Callback return empty array js
body: <p>Here is the function with in sql queries call.
  I need return callback only after all queries done.
  But it return an empty array
  How to return array with data after all?
  `</p>
  
  <pre><code>function getUserSales(days, callback){
    getUserByLastLoginDay(days, function (users) {
      var userArray = [];
      _.each(users, function (user) {
        getMostFavoredCat(user.id, function (cat) {
          if(!cat || cat.length == 0){
           return false;
          } else {
            user.mostFavoredCat = takeMostRepeatingObj(cat);
          }
          getRelatedSaleByCat(user.id, user.mostFavoredCat.id, function (sales) {
            user.sales = sales;
            userArray.push(user)
          })
        })
      })
      callback(userArray);
    })
  }
  </code></pre>
  
  <p>`</p>