Function.prototype.toString

Returns a string representation of a function.

For user-defined function, it is usually the source code of the function.

Syntax

toString()

Examples

function sum(a, b) { return a + b }
sum.toString()
"function sum(a, b) { return a + b }"
print(Math.sin.toString())
function sin() {
    [native code]
}