Trying to run this code in nodejs but this returns undefined. but if i do "console.log(status)" inside de "client.get" function, this shows the right value. i'm using request-json node package. i would like a good explanation about, please.
let status;
client.get(client.host).then((result) => {
status = result.res.statusCode;
});
return status;