Nodejs how to get the prototype of a function like the debugger

43 Views Asked by At

In Nodejs, I am trying to get the prototype name of a function defined like:

AgreementSchema.statics.saveAgreement = function(){...}

When I check the Web-storm debugger, it can fetch the type of it and display it. I tried different things like prototype.constructor.name etc but since it is defined as an anonymous function it doesn't work.

You can check the debugger screenshot below, and see that "model.saveAgreement.prototype" is shown with "AgreementSchema.statics.saveAgreement".

enter image description here

Is there a way that I can get the name of this function as String like the debugger does?

0

There are 0 best solutions below