How to view a function body in node.js?

I only get [Function] when I try to display the function :

> var a = function(){ return 'toto'; }
undefined
> a
[Function]
> require('util').inspect(a)
'[Function]'

Answers


Use toString:

> var a = function(){ return 'toto'; }
undefined
> a.toString()
'function (){ return \'toto\'; }'

Need Your Help

ASP.NET Identity vs Simple membership Pros and Cons?

asp.net-mvc asp.net-mvc-4 asp.net-mvc-5 simplemembership asp.net-identity

In MVC4 we had Simple Membership. My opinion is that Simple Membership was a good Identity Model tried and tested with good documentation and didn't need to be fixed but simply needed an upgrade in...

Why do event handlers always have a return type of void?

c# .net events event-handling

Hey, I wondered why is it that the return type of events such as