目前我正在嘗試創建一個蒸汽交易機器人,只有在接收到的物品價值高於所提供的物品時才接受報價。 ......我正在爲蒸汽交易創建一個機器人,在添加數組值時遇到了一些麻煩
var market = require('steam-market-pricing');
var names = [
'AWP | Safari Mesh (Factory New)',
'AWP | Safari Mesh (Minimal Wear)',
'AWP | Safari Mesh (Field-Tested)',
'AWP | Safari Mesh (Well-Worn)',
'AWP | Safari Mesh (Battle-Scarred)'
];
market.getItemsPrice(730, names, function(data) {
for(var i in names) {
console.log(names[i] + data[names[i]]['median_price']);
}
});
上面的代碼可以發現,我的「名字」數組中列出的項目的個別價格,但我會如何加起來他們的每一個價格的共創造?
Here's the package I used to find prices
嘗試這樣做,並獲得「NaN」作爲回報。 –