Rather than use callbacks, I decided to use promises.
I resolve the variable which holds a price and then I call .then to handle it like this.
SomeAsyncThing("fifa 17").then(function(value){
console.log("value " + value);
});
How can I assign the value to a global variable to use elsewhere in JS?
Am I missing something obvious? I've tried defining x = 0; at the top, then assigning value to x and calling console.log out of this function but I get 0 rather than the assigned value.