Skip to content

Instantly share code, notes, and snippets.

@iformas
Created January 14, 2017 23:53
Show Gist options
  • Save iformas/c65b5ba0a64a066c4a73cff498e56a05 to your computer and use it in GitHub Desktop.
Save iformas/c65b5ba0a64a066c4a73cff498e56a05 to your computer and use it in GitHub Desktop.
var userId= "";
request(data, function (error, response, body) {
if (!error && response.statusCode == 200) {
userId = body.user.id.toString();
console.log(userId);//muestra la respuesta corrrecta
}
});
console.log(userId);//no muestra nada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment