Hey guys I'm having trouble using the "appIds" variable outside the function scope, how can this be done? Here's the script below used in NodeJS:
var appIds = [];
request("http://api.steampowered.com/ISteamApps/GetAppList/v2?format=json", function(error, response, body) {
if (!error && response.statusCode == 200) {
var o = JSON.parse(body);
appIds = o.applist.apps.map(v => v.appid);
// console.log(appIds); works within scope.
}
});
console.log(appIds);