For example:
function ola() {
console.log("Olá =)");
}
function executar(callback) {
// quero descobrir o nome deste callback que é passado para cá
callback();
}
executar(ola);
In this way, the execute function will execute (rsrs) the callback, which in this case is the ola()
function. What I would like to know is: how can I, within the executar()
function, have access to the actual callback (hello) name, since in that scope I just use the alias "callback" to reference any function passed as argument?