I used request to get some infromation from API in nodejs. When i try to access these values outside braces it gives undefined.
var tab_det;
request.post({url:'https://ludochallenge.com/index.php/admin/get_table_id', form: {tournament_id:tournament_id}}, function(err,httpResponse,bodyy){
tab_det = bodyy
console.log('1 : ' + bodyy);
});
console.log('2 : ' + tab_det);
Result
1 : {"table_id":"2","player_turn":1}
2 : undefined
please help, Thanks in advance