As the title says, is it possible for me to place the following async function:
callArgos("fifa 17", function(title, price) {
console.log("Argos title " + title + " price " + price);
})
within another function say:
function foo() {
callArgos("fifa 17", function(title, price) {
console.log("Argos title " + title + " price " + price);
})
}
And then call function foo, to return title and price, and assign these to global variables?
I have three separate async functions which obtain prices from three different websites and the prices are returned using callbacks to those functions. I wish to then assign the values being returned to global variables, in order to compare all three prices. I'm not sure if it's possible in JS and Node.js.
What do you guys think?