2
How do I access the variable dados from within the function? Example below:
     var dados; 
     PagSeguroDirectPayment.getBrand({
            cardBin: this.pedidoSoft.numCard,
            success: function(response) {
                 dados = response;
            },
            error: function(response) {},
            complete: function(response) {}
    });
    console.log(dados);
This code is printing undefined in the console. I believe it is a variable scope problem. The variable being accessed inside is not the same as outside. How can I access this variable from within the function?
Thanks, buddy! That’s right!
– Jobsdev