I would like to save the return of an asynchronous function. The function is as follows:
cb.tabela(serie).then(function(tabela) {
console.log(tabela);
}, function(err){
console.log(err);
});
What I wanted was to be able to do something like:
cb.tabela(serie).then(function(tabela) {
return tabela;
}, function(err){
console.log(err);
});
But when I do this I get a Promise {<pending>}
. Is there any way to save this return value?