It is not intended to scribble methods (or any functions) - especially since most methods of built-in objects (and, therefore, prototypes of any user-defined objects) are native code.
If you really need to print your methods, you can override your .toString method, but when you call JSON.parse on the line output, it will process the method as if it were just a string, and be able to name it as a function, which you should use for eval
is a practice that is usually not recommended.
Jking source share