I only get [Function] when I try to display the function :
> var a = function(){ return 'toto'; }
undefined
> a
[Function]
> require('util').inspect(a)
'[Function]'
Use toString
:
> var a = function(){ return 'toto'; }
undefined
> a.toString()
'function (){ return \'toto\'; }'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With