I'm trying to get the name of the function that called another function.
class ABC {
static method_A() {
ABC.method_B();
}
static method_B() {
console.log('B method');
//Need to get the name of the method that called this method (e.g. method_A())
}
}
I've looked around and there is a deprecated way of doing it
and a non-standard way of doing it. But both are not working for me, I'm getting an undefined
error when I try to use any of them. Just wanted to make sure is it because they are static
methods?