What is toString () in JavaScript?

toString . For user-defined Function objects, the toString method returns a string containing the source text segment which was used to define the function . JavaScript calls the toString method automatically when a Function is to be represented as a text value, e.g. when a function is concatenated with a string.

Read more