Find the function that called the current method from within it by using the caller property:

js
function test() {
    // returns the body of the caller
    console.log(arguments.callee.caller);
    // returns the full prototype name of the caller
    console.log(arguments.callee.caller.prototype);
}