var myF = function () {}; myF.toString = function () { return 'function myFinction() { [native code] }'; }; alert(myF);