HeeysamH Posted January 13, 2017 Report Posted January 13, 2017 Hey,I made this code:for(var i = 0; i < offer.itemsToReceive.length; i++){getPrices(offer.itemsToReceive).then(function(val){console.log(val);}).catch(function(err) {console.log(err);});} it prints the values of the items i receive in the trade.How do i make it so it just prints the total value, so all the item prices in one total. Quote
Dr. McKay Posted January 13, 2017 Report Posted January 13, 2017 That's slightly tricky with async requests. You may want to use a module like https://www.npmjs.com/package/async Quote
HeeysamH Posted January 13, 2017 Author Report Posted January 13, 2017 Is theire another way to get the prices of items easy without having to deal with all of this. im new to nodejs so i have no idea what to do Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.