How do i get the value of variable 'price' and pass it as a global variable so I can use it elsewhere in my program?
gdax.loadMidMarketPrice(product).then((price: BigJS) => {
console.log('Mid-market Price: $${price}/BTC');
}).catch(logError);
I tried this but the variable is not visible outside the function
gdax.loadMidMarketPrice(product).then((price: BigJS) => {
var midprice=price;
console.log('Mid-market Price: $${price}/BTC');
}).catch(logError);