I have a function that creates an object based on db data, and some web_based json.
function makeObject(dbdata){
   var obj = {};
   obj.id = dbdata.id;
   obj.url = dbdata.url;
   request(dbdata.url,function(err,res,body){
      obj.inventory = JSON.parse(body).inventory;
   });
   return obj
}
This obviously doesn't fill in the inventory property (async, etc...) nor does it work with the return inside request. I know the answer is pretty basic, but I just can't see it. help,please!
 
    