function listLabels(userId, callback) {
var request = gapi.client.gmail.users.labels.list({
'userId': 'me'
});
request.execute(function(resp) {
var labels = resp.labels;
console.log(labels);
// callback(labels)
});
}
The request object accessed is made for labels but when labels is logged it returns undefined
.