16austin16 16austin16 - 4 months ago 23
Node.js Question

Using var in nodejs to search a json file

So im trying to search a json file but i tried this and it didn't return a value.

var info = JSON.parse(body); // Get File From Website
var itemforjson = item.market_hash_name; // Get The Item Name To Try To Use It In Json
depitems[i].value = parseInt(info.itemforjson); // Has To Be A Number


Use parseInt(info[itemforjson]) on the last line.