If this is a user-defined function, you can use:
console.log(callback.toString());
Otherwise, you just get something like [native code] , since the built-in functions are not written in JavaScript.
Example:
function x(){}
Paulpro Feb 27 '12 at 6:26 2012-02-27 06:26
source share