javascript - Change output of function object to state its name -


i trying basic lambda calculus in javascript , using node repl. define identity , mockinbird combinator , run mockingbird combinator identity combinator input.

i = f => f m = f => f(f) m(i) 

the mockinbird combinator identity combinator input yields identity combinator. last line gives following output.

[function] 

but more useful, in case, if outputted following.

[function: i] 

this way can see function being printed. have seen done in youtube video: https://www.youtube.com/watch?v=3vq382qg-y4

does have idea how achieve this?

newer versions of node.js (at least v6+, maybe earlier). if don't want upgrade, define inspect method, node.js use when inspecting:

function.prototype.inspect = function () {   return "[function: " + this.name + "]"; } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -